Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: packages/usage/test/usage_impl_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/usage/test/usage_impl_io_test.dart ('k') | packages/usage/test/usage_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/usage/test/usage_impl_test.dart
diff --git a/packages/usage/test/usage_impl_test.dart b/packages/usage/test/usage_impl_test.dart
index b8c0f052cdb41cf43da482f806178d6f73817599..a4ca3ac99baeed9148d079bc23ca41bfd679a201 100644
--- a/packages/usage/test/usage_impl_test.dart
+++ b/packages/usage/test/usage_impl_test.dart
@@ -28,19 +28,34 @@ void defineTests() {
});
group('AnalyticsImpl', () {
+ test('trackingId', () {
+ AnalyticsImplMock mock = createMock();
+ expect(mock.trackingId, isNotNull);
+ });
+
+ test('applicationName', () {
+ AnalyticsImplMock mock = createMock();
+ expect(mock.applicationName, isNotNull);
+ });
+
+ test('applicationVersion', () {
+ AnalyticsImplMock mock = createMock();
+ expect(mock.applicationVersion, isNotNull);
+ });
+
test('respects disabled', () {
AnalyticsImplMock mock = createMock();
- mock.optIn = false;
+ mock.enabled = false;
mock.sendException('FooBar exception');
- expect(mock.optIn, false);
+ expect(mock.enabled, false);
expect(mock.mockPostHandler.sentValues, isEmpty);
});
- test('hasSetOptIn', () {
- AnalyticsImplMock mock = createMock(setOptIn: false);
- expect(mock.hasSetOptIn, false);
- mock.optIn = false;
- expect(mock.hasSetOptIn, true);
+ test('firstRun', () {
+ AnalyticsImplMock mock = createMock();
+ expect(mock.firstRun, true);
+ mock = createMock(props: {'firstRun': false});
+ expect(mock.firstRun, false);
});
test('setSessionValue', () {
@@ -62,6 +77,28 @@ void defineTests() {
mock.sendScreenView('baz');
return mock.waitForLastPing(timeout: new Duration(milliseconds: 100));
});
+
+ group('clientId', () {
+ test('is available immediately', () {
+ AnalyticsImplMock mock = createMock();
+ expect(mock.clientId, isNotEmpty);
+ });
+
+ test('is memoized', () {
+ AnalyticsImplMock mock = createMock();
+ final value1 = mock.clientId;
+ final value2 = mock.clientId;
+ expect(value1, isNotEmpty);
+ expect(value1, value2);
+ });
+
+ test('is stored in properties', () {
+ AnalyticsImplMock mock = createMock();
+ expect(mock.properties['clientId'], isNull);
+ final value = mock.clientId;
+ expect(mock.properties['clientId'], value);
+ });
+ });
});
group('postEncode', () {
« no previous file with comments | « packages/usage/test/usage_impl_io_test.dart ('k') | packages/usage/test/usage_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698