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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chromeos/login/users/user_manager.h" | 10 #include "chrome/browser/chromeos/login/users/user_manager.h" |
11 #include "chrome/browser/extensions/extension_apitest.h" | 11 #include "chrome/browser/extensions/extension_apitest.h" |
12 #include "chrome/test/base/ui_test_utils.h" | 12 #include "chrome/test/base/ui_test_utils.h" |
13 #include "components/user_manager/user.h" | 13 #include "components/user_manager/user.h" |
14 #include "extensions/common/switches.h" | 14 #include "extensions/common/switches.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
16 | 16 |
17 #if defined(OS_CHROMEOS) | 17 #if defined(OS_CHROMEOS) |
18 #include "chrome/browser/chrome_notification_types.h" | |
19 #include "chrome/browser/chromeos/login/helper.h" | 18 #include "chrome/browser/chromeos/login/helper.h" |
20 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" | 19 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" |
21 #include "chromeos/chromeos_switches.h" | 20 #include "chromeos/chromeos_switches.h" |
22 #include "chromeos/dbus/cryptohome_client.h" | 21 #include "chromeos/dbus/cryptohome_client.h" |
23 #include "chromeos/dbus/dbus_thread_manager.h" | 22 #include "chromeos/dbus/dbus_thread_manager.h" |
24 #include "chromeos/dbus/shill_device_client.h" | 23 #include "chromeos/dbus/shill_device_client.h" |
25 #include "chromeos/dbus/shill_ipconfig_client.h" | 24 #include "chromeos/dbus/shill_ipconfig_client.h" |
26 #include "chromeos/dbus/shill_manager_client.h" | 25 #include "chromeos/dbus/shill_manager_client.h" |
27 #include "chromeos/dbus/shill_profile_client.h" | 26 #include "chromeos/dbus/shill_profile_client.h" |
28 #include "chromeos/dbus/shill_service_client.h" | 27 #include "chromeos/dbus/shill_service_client.h" |
29 #include "chromeos/login/user_names.h" | 28 #include "chromeos/login/user_names.h" |
30 #include "chromeos/network/onc/onc_utils.h" | 29 #include "chromeos/network/onc/onc_utils.h" |
31 #include "chromeos/network/portal_detector/network_portal_detector.h" | 30 #include "chromeos/network/portal_detector/network_portal_detector.h" |
32 #include "components/onc/onc_constants.h" | 31 #include "components/onc/onc_constants.h" |
33 #include "components/policy/core/browser/browser_policy_connector.h" | 32 #include "components/policy/core/browser/browser_policy_connector.h" |
34 #include "components/policy/core/common/external_data_fetcher.h" | 33 #include "components/policy/core/common/external_data_fetcher.h" |
35 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 34 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
36 #include "components/policy/core/common/policy_map.h" | 35 #include "components/policy/core/common/policy_map.h" |
37 #include "components/policy/core/common/policy_types.h" | 36 #include "components/policy/core/common/policy_types.h" |
38 #include "content/public/browser/notification_observer.h" | 37 #include "content/public/browser/notification_observer.h" |
39 #include "content/public/browser/notification_registrar.h" | 38 #include "content/public/browser/notification_registrar.h" |
40 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
41 #include "content/public/browser/notification_source.h" | 40 #include "content/public/browser/notification_source.h" |
| 41 #include "extensions/browser/notification_types.h" |
42 #include "policy/policy_constants.h" | 42 #include "policy/policy_constants.h" |
43 #include "third_party/cros_system_api/dbus/service_constants.h" | 43 #include "third_party/cros_system_api/dbus/service_constants.h" |
44 #else // !defined(OS_CHROMEOS) | 44 #else // !defined(OS_CHROMEOS) |
45 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
edentials_getter.h" | 45 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
edentials_getter.h" |
46 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client.h" | 46 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client.h" |
47 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client_factory.h" | 47 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client_factory.h" |
48 #include "components/wifi/fake_wifi_service.h" | 48 #include "components/wifi/fake_wifi_service.h" |
49 #endif // defined(OS_CHROMEOS) | 49 #endif // defined(OS_CHROMEOS) |
50 | 50 |
51 // TODO(stevenjb/mef): Clean these tests up. crbug.com/371442 | 51 // TODO(stevenjb/mef): Clean these tests up. crbug.com/371442 |
(...skipping 23 matching lines...) Expand all Loading... |
75 const char kUser1ProfilePath[] = "/profile/user1/shill"; | 75 const char kUser1ProfilePath[] = "/profile/user1/shill"; |
76 const char kWifiDevicePath[] = "/device/stub_wifi_device1"; | 76 const char kWifiDevicePath[] = "/device/stub_wifi_device1"; |
77 const char kCellularDevicePath[] = "/device/stub_cellular_device1"; | 77 const char kCellularDevicePath[] = "/device/stub_cellular_device1"; |
78 const char kIPConfigPath[] = "/ipconfig/ipconfig1"; | 78 const char kIPConfigPath[] = "/ipconfig/ipconfig1"; |
79 | 79 |
80 class TestListener : public content::NotificationObserver { | 80 class TestListener : public content::NotificationObserver { |
81 public: | 81 public: |
82 TestListener(const std::string& message, const base::Closure& callback) | 82 TestListener(const std::string& message, const base::Closure& callback) |
83 : message_(message), callback_(callback) { | 83 : message_(message), callback_(callback) { |
84 registrar_.Add(this, | 84 registrar_.Add(this, |
85 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, | 85 extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE, |
86 content::NotificationService::AllSources()); | 86 content::NotificationService::AllSources()); |
87 } | 87 } |
88 | 88 |
89 virtual void Observe(int type, | 89 virtual void Observe(int type, |
90 const content::NotificationSource& /* source */, | 90 const content::NotificationSource& /* source */, |
91 const content::NotificationDetails& details) OVERRIDE { | 91 const content::NotificationDetails& details) OVERRIDE { |
92 const std::string& message = *content::Details<std::string>(details).ptr(); | 92 const std::string& message = *content::Details<std::string>(details).ptr(); |
93 if (message == message_) | 93 if (message == message_) |
94 callback_.Run(); | 94 callback_.Run(); |
95 } | 95 } |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 | 611 |
612 TestListener listener( | 612 TestListener listener( |
613 "notifyPortalDetectorObservers", | 613 "notifyPortalDetectorObservers", |
614 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting, | 614 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting, |
615 base::Unretained(detector()))); | 615 base::Unretained(detector()))); |
616 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; | 616 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; |
617 } | 617 } |
618 #endif // defined(OS_CHROMEOS) | 618 #endif // defined(OS_CHROMEOS) |
619 | 619 |
620 } // namespace | 620 } // namespace |
OLD | NEW |