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/callback.h" | 5 #include "base/callback.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/chromeos/login/user.h" | 8 #include "chrome/browser/chromeos/login/user.h" |
9 #include "chrome/browser/chromeos/login/user_manager.h" | 9 #include "chrome/browser/chromeos/login/user_manager.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chromeos/dbus/shill_manager_client.h" | 25 #include "chromeos/dbus/shill_manager_client.h" |
26 #include "chromeos/dbus/shill_profile_client.h" | 26 #include "chromeos/dbus/shill_profile_client.h" |
27 #include "chromeos/dbus/shill_service_client.h" | 27 #include "chromeos/dbus/shill_service_client.h" |
28 #include "chromeos/dbus/shill_stub_helper.h" | 28 #include "chromeos/dbus/shill_stub_helper.h" |
29 #include "chromeos/network/onc/onc_utils.h" | 29 #include "chromeos/network/onc/onc_utils.h" |
30 #include "components/onc/onc_constants.h" | 30 #include "components/onc/onc_constants.h" |
31 #include "policy/policy_constants.h" | 31 #include "policy/policy_constants.h" |
32 #include "third_party/cros_system_api/dbus/service_constants.h" | 32 #include "third_party/cros_system_api/dbus/service_constants.h" |
33 #endif // OS_CHROMEOS | 33 #endif // OS_CHROMEOS |
34 | 34 |
35 using testing::AnyNumber; | |
36 using testing::Return; | 35 using testing::Return; |
37 using testing::_; | 36 using testing::_; |
38 | 37 |
39 namespace chromeos { | 38 namespace chromeos { |
40 | 39 |
41 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
42 const char kUser1ProfilePath[] = "/profile/user1/shill"; | 41 const char kUser1ProfilePath[] = "/profile/user1/shill"; |
43 #endif // defined(OS_CHROMEOS) | 42 #endif // defined(OS_CHROMEOS) |
44 | 43 |
45 class ExtensionNetworkingPrivateApiTest : | 44 class ExtensionNetworkingPrivateApiTest : |
46 public ExtensionApiTest, | 45 public ExtensionApiTest, |
47 public testing::WithParamInterface<bool> { | 46 public testing::WithParamInterface<bool> { |
48 public: | 47 public: |
49 bool RunNetworkingSubtest(const std::string& subtest) { | 48 bool RunNetworkingSubtest(const std::string& subtest) { |
50 return RunExtensionSubtest( | 49 return RunExtensionSubtest( |
51 "networking", "main.html?" + subtest, | 50 "networking", "main.html?" + subtest, |
52 kFlagEnableFileAccess | kFlagLoadAsComponent); | 51 kFlagEnableFileAccess | kFlagLoadAsComponent); |
53 } | 52 } |
54 | 53 |
55 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 54 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
56 #if defined(OS_CHROMEOS) | 55 #if defined(OS_CHROMEOS) |
57 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 56 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
58 .WillRepeatedly(Return(true)); | 57 .WillRepeatedly(Return(true)); |
59 EXPECT_CALL(provider_, RegisterPolicyDomain(_)).Times(AnyNumber()); | |
60 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 58 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
61 #endif | 59 #endif |
62 | 60 |
63 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 61 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
64 } | 62 } |
65 | 63 |
66 #if defined(OS_CHROMEOS) | 64 #if defined(OS_CHROMEOS) |
67 static void AssignString(std::string* out, | 65 static void AssignString(std::string* out, |
68 DBusMethodCallStatus call_status, | 66 DBusMethodCallStatus call_status, |
69 const std::string& result) { | 67 const std::string& result) { |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 IN_PROC_BROWSER_TEST_P(ExtensionNetworkingPrivateApiTest, | 379 IN_PROC_BROWSER_TEST_P(ExtensionNetworkingPrivateApiTest, |
382 VerifyAndEncryptData) { | 380 VerifyAndEncryptData) { |
383 EXPECT_TRUE(RunNetworkingSubtest("verifyAndEncryptData")) << message_; | 381 EXPECT_TRUE(RunNetworkingSubtest("verifyAndEncryptData")) << message_; |
384 } | 382 } |
385 | 383 |
386 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation, | 384 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation, |
387 ExtensionNetworkingPrivateApiTest, | 385 ExtensionNetworkingPrivateApiTest, |
388 testing::Bool()); | 386 testing::Bool()); |
389 | 387 |
390 } // namespace chromeos | 388 } // namespace chromeos |
OLD | NEW |