| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 29 #include "chrome/common/extensions/extension.h" | 29 #include "chrome/common/extensions/extension.h" |
| 30 #include "policy/proto/cloud_policy.pb.h" | 30 #include "policy/proto/cloud_policy.pb.h" |
| 31 #include "testing/gmock/include/gmock/gmock.h" | 31 #include "testing/gmock/include/gmock/gmock.h" |
| 32 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
| 33 | 33 |
| 34 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
| 35 #include "chrome/browser/chromeos/login/user_manager.h" | 35 #include "chrome/browser/chromeos/login/user_manager.h" |
| 36 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 36 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| 37 #include "chrome/common/chrome_paths.h" | 37 #include "chrome/common/chrome_paths.h" |
| 38 #include "chromeos/chromeos_switches.h" |
| 38 #include "chromeos/dbus/mock_cryptohome_client.h" | 39 #include "chromeos/dbus/mock_cryptohome_client.h" |
| 39 #include "chromeos/dbus/mock_dbus_thread_manager.h" | 40 #include "chromeos/dbus/mock_dbus_thread_manager.h" |
| 40 #include "chromeos/dbus/mock_session_manager_client.h" | 41 #include "chromeos/dbus/mock_session_manager_client.h" |
| 41 #include "chromeos/dbus/mock_update_engine_client.h" | 42 #include "chromeos/dbus/mock_update_engine_client.h" |
| 42 #else | 43 #else |
| 43 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" | 44 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" |
| 44 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 45 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
| 45 #include "chrome/browser/signin/signin_manager.h" | 46 #include "chrome/browser/signin/signin_manager.h" |
| 46 #include "chrome/browser/signin/signin_manager_factory.h" | 47 #include "chrome/browser/signin/signin_manager_factory.h" |
| 47 #endif | 48 #endif |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 protected: | 132 protected: |
| 132 ComponentCloudPolicyTest() {} | 133 ComponentCloudPolicyTest() {} |
| 133 virtual ~ComponentCloudPolicyTest() {} | 134 virtual ~ComponentCloudPolicyTest() {} |
| 134 | 135 |
| 135 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 136 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 136 ExtensionBrowserTest::SetUpCommandLine(command_line); | 137 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 137 #if defined(OS_CHROMEOS) | 138 #if defined(OS_CHROMEOS) |
| 138 // ExtensionBrowserTest sets the login users to a non-managed value; | 139 // ExtensionBrowserTest sets the login users to a non-managed value; |
| 139 // replace it. This is the default username sent in policy blobs from the | 140 // replace it. This is the default username sent in policy blobs from the |
| 140 // testserver. | 141 // testserver. |
| 141 command_line->AppendSwitchASCII(switches::kLoginUser, "user@example.com"); | 142 command_line->AppendSwitchASCII( |
| 143 chromeos::switches::kLoginUser, "user@example.com"); |
| 142 #endif | 144 #endif |
| 143 } | 145 } |
| 144 | 146 |
| 145 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 147 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 146 test_server_.RegisterClient(kDMToken, kDeviceID); | 148 test_server_.RegisterClient(kDMToken, kDeviceID); |
| 147 EXPECT_TRUE(test_server_.UpdatePolicyData( | 149 EXPECT_TRUE(test_server_.UpdatePolicyData( |
| 148 dm_protocol::kChromeExtensionPolicyType, kTestExtension, kTestPolicy)); | 150 dm_protocol::kChromeExtensionPolicyType, kTestExtension, kTestPolicy)); |
| 149 ASSERT_TRUE(test_server_.Start()); | 151 ASSERT_TRUE(test_server_.Start()); |
| 150 | 152 |
| 151 std::string url = test_server_.GetServiceURL().spec(); | 153 std::string url = test_server_.GetServiceURL().spec(); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 ASSERT_EQ(kTestExtension2, extension2->id()); | 321 ASSERT_EQ(kTestExtension2, extension2->id()); |
| 320 | 322 |
| 321 // This extension only sends the 'policy' signal once it receives the policy, | 323 // This extension only sends the 'policy' signal once it receives the policy, |
| 322 // and after verifying it has the expected value. Otherwise it sends 'fail'. | 324 // and after verifying it has the expected value. Otherwise it sends 'fail'. |
| 323 EXPECT_TRUE(result_listener.WaitUntilSatisfied()); | 325 EXPECT_TRUE(result_listener.WaitUntilSatisfied()); |
| 324 } | 326 } |
| 325 | 327 |
| 326 #endif // OS_CHROMEOS | 328 #endif // OS_CHROMEOS |
| 327 | 329 |
| 328 } // namespace policy | 330 } // namespace policy |
| OLD | NEW |