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

Side by Side Diff: chrome/browser/chromeos/net/network_portal_notification_controller_unittest.cc

Issue 635573005: Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, nit Created 6 years, 1 month 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/chromeos/net/network_portal_notification_controller.h" 6 #include "chrome/browser/chromeos/net/network_portal_notification_controller.h"
7 #include "chromeos/chromeos_switches.h" 7 #include "chromeos/chromeos_switches.h"
8 #include "chromeos/network/network_state.h" 8 #include "chromeos/network/network_state.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/message_center/message_center.h" 10 #include "ui/message_center/message_center.h"
11 #include "ui/message_center/message_center_observer.h" 11 #include "ui/message_center/message_center_observer.h"
12 12
13 using message_center::MessageCenter; 13 using message_center::MessageCenter;
14 14
15 namespace chromeos { 15 namespace chromeos {
16 16
17 namespace { 17 namespace {
18 18
19 const char* kNotificationId = 19 const char* const kNotificationId =
20 NetworkPortalNotificationController::kNotificationId; 20 NetworkPortalNotificationController::kNotificationId;
21 21
22 bool HasNotification() { 22 bool HasNotification() {
23 MessageCenter* message_center = MessageCenter::Get(); 23 MessageCenter* message_center = MessageCenter::Get();
24 return message_center->FindVisibleNotificationById(kNotificationId); 24 return message_center->FindVisibleNotificationById(kNotificationId);
25 } 25 }
26 26
27 class NotificationObserver : public message_center::MessageCenterObserver { 27 class NotificationObserver : public message_center::MessageCenterObserver {
28 public: 28 public:
29 NotificationObserver() : add_count_(0), remove_count_(0), update_count_(0) {} 29 NotificationObserver() : add_count_(0), remove_count_(0), update_count_(0) {}
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // Network was switched (by shill or by user) to wifi1. Notification 191 // Network was switched (by shill or by user) to wifi1. Notification
192 // should be displayed. 192 // should be displayed.
193 OnPortalDetectionCompleted(&wifi1, portal_state); 193 OnPortalDetectionCompleted(&wifi1, portal_state);
194 ASSERT_TRUE(HasNotification()); 194 ASSERT_TRUE(HasNotification());
195 EXPECT_EQ(2u, observer().add_count()); 195 EXPECT_EQ(2u, observer().add_count());
196 EXPECT_EQ(1u, observer().remove_count()); 196 EXPECT_EQ(1u, observer().remove_count());
197 EXPECT_EQ(1u, observer().update_count()); 197 EXPECT_EQ(1u, observer().update_count());
198 } 198 }
199 199
200 } // namespace chromeos 200 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698