-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix DevTools extension analytics (#6651)
- Loading branch information
1 parent
4474099
commit 348a6c7
Showing
21 changed files
with
193 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
packages/devtools_app/test/extensions/extension_analytics_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// Copyright 2023 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:devtools_app/src/shared/analytics/constants.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import '../test_infra/test_data/extensions.dart'; | ||
|
||
void main() { | ||
group('DevTools extension analytics', () { | ||
test( | ||
'uses extension name for public package', | ||
() { | ||
final public = providerExtension; | ||
expect(public.isPubliclyHosted, true); | ||
expect(public.name, 'provider'); | ||
expect(public.analyticsSafeName, 'provider'); | ||
expect( | ||
DevToolsExtensionEvents.extensionScreenName(public), | ||
'extension-provider', | ||
); | ||
expect( | ||
DevToolsExtensionEvents.extensionFeedback(public), | ||
'extensionFeedback-provider', | ||
); | ||
expect( | ||
DevToolsExtensionEvents.extensionEnableManual(public), | ||
'extensionEnable-manual-provider', | ||
); | ||
expect( | ||
DevToolsExtensionEvents.extensionEnablePrompt(public), | ||
'extensionEnable-prompt-provider', | ||
); | ||
expect( | ||
DevToolsExtensionEvents.extensionDisableManual(public), | ||
'extensionDisable-manual-provider', | ||
); | ||
|
||
expect( | ||
DevToolsExtensionEvents.extensionDisablePrompt(public), | ||
'extensionDisable-prompt-provider', | ||
); | ||
expect( | ||
DevToolsExtensionEvents.extensionForceReload(public), | ||
'extensionForceReload-provider', | ||
); | ||
}, | ||
); | ||
|
||
test( | ||
'does not use extension name for private package', | ||
() { | ||
final private = fooExtension; | ||
expect(private.isPubliclyHosted, false); | ||
expect(private.name, 'Foo'); | ||
expect(private.analyticsSafeName, 'private'); | ||
expect( | ||
DevToolsExtensionEvents.extensionScreenName(private), | ||
'extension-private', | ||
); | ||
expect( | ||
DevToolsExtensionEvents.extensionFeedback(private), | ||
'extensionFeedback-private', | ||
); | ||
expect( | ||
DevToolsExtensionEvents.extensionEnableManual(private), | ||
'extensionEnable-manual-private', | ||
); | ||
expect( | ||
DevToolsExtensionEvents.extensionEnablePrompt(private), | ||
'extensionEnable-prompt-private', | ||
); | ||
expect( | ||
DevToolsExtensionEvents.extensionDisableManual(private), | ||
'extensionDisable-manual-private', | ||
); | ||
|
||
expect( | ||
DevToolsExtensionEvents.extensionDisablePrompt(private), | ||
'extensionDisable-prompt-private', | ||
); | ||
expect( | ||
DevToolsExtensionEvents.extensionForceReload(private), | ||
'extensionForceReload-private', | ||
); | ||
}, | ||
); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.