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

Side by Side Diff: chrome/browser/notifications/extension_welcome_notification_unittest.cc

Issue 1305213009: Componentize PrefSyncableService and support classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pref_service_syncable
Patch Set: Add missing dependency on //sync:test_support_sync_api for unit tests with gn Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/notifications/extension_welcome_notification.h" 5 #include "chrome/browser/notifications/extension_welcome_notification.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/test/test_simple_task_runner.h" 13 #include "base/test/test_simple_task_runner.h"
14 #include "base/thread_task_runner_handle.h" 14 #include "base/thread_task_runner_handle.h"
15 #include "chrome/browser/notifications/notification.h" 15 #include "chrome/browser/notifications/notification.h"
16 #include "chrome/browser/prefs/pref_service_syncable_util.h" 16 #include "chrome/browser/prefs/pref_service_syncable_util.h"
17 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
18 #include "chrome/test/base/testing_browser_process.h" 18 #include "chrome/test/base/testing_browser_process.h"
19 #include "chrome/test/base/testing_pref_service_syncable.h"
20 #include "chrome/test/base/testing_profile.h" 19 #include "chrome/test/base/testing_profile.h"
21 #include "components/pref_registry/pref_registry_syncable.h" 20 #include "components/pref_registry/pref_registry_syncable.h"
21 #include "components/syncable_prefs/testing_pref_service_syncable.h"
22 #include "sync/api/fake_sync_change_processor.h" 22 #include "sync/api/fake_sync_change_processor.h"
23 #include "sync/api/sync_error_factory_mock.h" 23 #include "sync/api/sync_error_factory_mock.h"
24 #include "testing/gtest/include/gtest/gtest.h" 24 #include "testing/gtest/include/gtest/gtest.h"
25 #include "ui/message_center/fake_message_center.h" 25 #include "ui/message_center/fake_message_center.h"
26 #include "ui/message_center/notification.h" 26 #include "ui/message_center/notification.h"
27 27
28 class MockMessageCenter : public message_center::FakeMessageCenter { 28 class MockMessageCenter : public message_center::FakeMessageCenter {
29 public: 29 public:
30 MockMessageCenter() 30 MockMessageCenter()
31 : add_notification_calls_(0), 31 : add_notification_calls_(0),
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 EXPECT_TRUE(task_runner()->GetPendingTasks().empty()); 526 EXPECT_TRUE(task_runner()->GetPendingTasks().empty());
527 EXPECT_EQ(message_center()->add_notification_calls(), 0); 527 EXPECT_EQ(message_center()->add_notification_calls(), 0);
528 EXPECT_EQ(message_center()->remove_notification_calls(), 0); 528 EXPECT_EQ(message_center()->remove_notification_calls(), 0);
529 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0); 529 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0);
530 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed)); 530 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed));
531 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal)); 531 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal));
532 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp)); 532 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp));
533 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1); 533 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1);
534 } 534 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698