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

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

Issue 2907493002: ChromeOS: Per-user time zone: refactor tests first. (Closed)
Patch Set: Fix debug build Created 3 years, 6 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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 ExtensionWelcomeNotificationTest() { 132 ExtensionWelcomeNotificationTest() {
133 scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry( 133 scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry(
134 new user_prefs::PrefRegistrySyncable()); 134 new user_prefs::PrefRegistrySyncable());
135 ExtensionWelcomeNotification::RegisterProfilePrefs(pref_registry.get()); 135 ExtensionWelcomeNotification::RegisterProfilePrefs(pref_registry.get());
136 } 136 }
137 137
138 void SetUp() override { 138 void SetUp() override {
139 task_runner_ = new base::TestSimpleTaskRunner(); 139 task_runner_ = new base::TestSimpleTaskRunner();
140 base::MessageLoop::current()->SetTaskRunner(task_runner_); 140 base::MessageLoop::current()->SetTaskRunner(task_runner_);
141 profile_.reset(new TestingProfile()); 141 profile_.reset(new TestingProfile());
142 task_runner()->RunUntilIdle();
142 delegate_ = new WelcomeNotificationDelegate(); 143 delegate_ = new WelcomeNotificationDelegate();
143 welcome_notification_.reset( 144 welcome_notification_.reset(
144 ExtensionWelcomeNotification::Create(profile_.get(), delegate_)); 145 ExtensionWelcomeNotification::Create(profile_.get(), delegate_));
145 } 146 }
146 147
147 void TearDown() override { 148 void TearDown() override {
148 delegate_ = NULL; 149 delegate_ = NULL;
149 welcome_notification_.reset(); 150 welcome_notification_.reset();
150 profile_.reset(); 151 profile_.reset();
151 TestingBrowserProcess::DeleteInstance(); 152 TestingBrowserProcess::DeleteInstance();
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 530
530 EXPECT_FALSE(task_runner()->HasPendingTask()); 531 EXPECT_FALSE(task_runner()->HasPendingTask());
531 EXPECT_EQ(message_center()->add_notification_calls(), 0); 532 EXPECT_EQ(message_center()->add_notification_calls(), 0);
532 EXPECT_EQ(message_center()->remove_notification_calls(), 0); 533 EXPECT_EQ(message_center()->remove_notification_calls(), 0);
533 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0); 534 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0);
534 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed)); 535 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed));
535 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal)); 536 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal));
536 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp)); 537 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp));
537 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1); 538 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1);
538 } 539 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698