OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 #else | 286 #else |
287 // ChromeOS always adds a system notifier to end of the list. | 287 // ChromeOS always adds a system notifier to end of the list. |
288 EXPECT_EQ(3u, notifiers.size()); | 288 EXPECT_EQ(3u, notifiers.size()); |
289 EXPECT_EQ(ash::system_notifier::kNotifierScreenshot, | 289 EXPECT_EQ(ash::system_notifier::kNotifierScreenshot, |
290 notifiers[2]->notifier_id.id); | 290 notifiers[2]->notifier_id.id); |
291 #endif | 291 #endif |
292 | 292 |
293 EXPECT_EQ(kBarId, notifiers[0]->notifier_id.id); | 293 EXPECT_EQ(kBarId, notifiers[0]->notifier_id.id); |
294 EXPECT_EQ(kFooId, notifiers[1]->notifier_id.id); | 294 EXPECT_EQ(kFooId, notifiers[1]->notifier_id.id); |
295 | 295 |
296 STLDeleteElements(¬ifiers); | 296 base::STLDeleteElements(¬ifiers); |
297 } | 297 } |
298 | 298 |
299 TEST_F(MessageCenterSettingsControllerTest, SetWebPageNotifierEnabled) { | 299 TEST_F(MessageCenterSettingsControllerTest, SetWebPageNotifierEnabled) { |
300 Profile* profile = CreateProfile("MyProfile"); | 300 Profile* profile = CreateProfile("MyProfile"); |
301 CreateController(); | 301 CreateController(); |
302 | 302 |
303 GURL origin("https://example.com/"); | 303 GURL origin("https://example.com/"); |
304 | 304 |
305 message_center::NotifierId notifier_id(origin); | 305 message_center::NotifierId notifier_id(origin); |
306 message_center::Notifier enabled_notifier( | 306 message_center::Notifier enabled_notifier( |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 EXPECT_EQ(blink::mojom::PermissionStatus::GRANTED, | 354 EXPECT_EQ(blink::mojom::PermissionStatus::GRANTED, |
355 permission_manager->GetPermissionStatus( | 355 permission_manager->GetPermissionStatus( |
356 content::PermissionType::NOTIFICATIONS, origin, origin)); | 356 content::PermissionType::NOTIFICATIONS, origin, origin)); |
357 | 357 |
358 // (6) Disable the permission when the default is blocked (expected to clear). | 358 // (6) Disable the permission when the default is blocked (expected to clear). |
359 controller()->SetNotifierEnabled(enabled_notifier, false); | 359 controller()->SetNotifierEnabled(enabled_notifier, false); |
360 EXPECT_EQ(blink::mojom::PermissionStatus::DENIED, | 360 EXPECT_EQ(blink::mojom::PermissionStatus::DENIED, |
361 permission_manager->GetPermissionStatus( | 361 permission_manager->GetPermissionStatus( |
362 content::PermissionType::NOTIFICATIONS, origin, origin)); | 362 content::PermissionType::NOTIFICATIONS, origin, origin)); |
363 } | 363 } |
OLD | NEW |