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

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

Issue 2072013002: mash: Move tray settings and deps to common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo 'git cl format' and nullptr changes. Created 4 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 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"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 12 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
13 #include "chrome/browser/extensions/extension_service.h" 13 #include "chrome/browser/extensions/extension_service.h"
14 #include "chrome/browser/extensions/test_extension_system.h" 14 #include "chrome/browser/extensions/test_extension_system.h"
15 #include "chrome/browser/notifications/message_center_settings_controller.h" 15 #include "chrome/browser/notifications/message_center_settings_controller.h"
16 #include "chrome/browser/permissions/permission_manager.h" 16 #include "chrome/browser/permissions/permission_manager.h"
17 #include "chrome/browser/profiles/profile_manager.h" 17 #include "chrome/browser/profiles/profile_manager.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_profile_manager.h" 19 #include "chrome/test/base/testing_profile_manager.h"
20 #include "components/content_settings/core/browser/host_content_settings_map.h" 20 #include "components/content_settings/core/browser/host_content_settings_map.h"
21 #include "content/public/browser/permission_type.h" 21 #include "content/public/browser/permission_type.h"
22 #include "content/public/test/test_browser_thread_bundle.h" 22 #include "content/public/test/test_browser_thread_bundle.h"
23 #include "extensions/common/extension.h" 23 #include "extensions/common/extension.h"
24 #include "extensions/common/extension_builder.h" 24 #include "extensions/common/extension_builder.h"
25 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
26 #include "ui/message_center/notifier_settings.h" 26 #include "ui/message_center/notifier_settings.h"
27 27
28 #if defined(OS_CHROMEOS) 28 #if defined(OS_CHROMEOS)
29 #include "ash/system/system_notifier.h" 29 #include "ash/common/system/system_notifier.h"
30 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" 30 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
31 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" 31 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
32 #endif 32 #endif
33 33
34 class MessageCenterSettingsControllerBaseTest : public testing::Test { 34 class MessageCenterSettingsControllerBaseTest : public testing::Test {
35 protected: 35 protected:
36 MessageCenterSettingsControllerBaseTest() 36 MessageCenterSettingsControllerBaseTest()
37 : testing_profile_manager_(TestingBrowserProcess::GetGlobal()) {} 37 : testing_profile_manager_(TestingBrowserProcess::GetGlobal()) {}
38 38
39 ~MessageCenterSettingsControllerBaseTest() override{}; 39 ~MessageCenterSettingsControllerBaseTest() override{};
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698