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

Side by Side Diff: trunk/src/chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc

Issue 13590004: Revert 192504 "Re-apply 192420: Move login switches to src/chromeos" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
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
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"
39 #include "chromeos/dbus/mock_cryptohome_client.h" 38 #include "chromeos/dbus/mock_cryptohome_client.h"
40 #include "chromeos/dbus/mock_dbus_thread_manager.h" 39 #include "chromeos/dbus/mock_dbus_thread_manager.h"
41 #include "chromeos/dbus/mock_session_manager_client.h" 40 #include "chromeos/dbus/mock_session_manager_client.h"
42 #include "chromeos/dbus/mock_update_engine_client.h" 41 #include "chromeos/dbus/mock_update_engine_client.h"
43 #else 42 #else
44 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" 43 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h"
45 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" 44 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
46 #include "chrome/browser/signin/signin_manager.h" 45 #include "chrome/browser/signin/signin_manager.h"
47 #include "chrome/browser/signin/signin_manager_factory.h" 46 #include "chrome/browser/signin/signin_manager_factory.h"
48 #endif 47 #endif
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 protected: 131 protected:
133 ComponentCloudPolicyTest() {} 132 ComponentCloudPolicyTest() {}
134 virtual ~ComponentCloudPolicyTest() {} 133 virtual ~ComponentCloudPolicyTest() {}
135 134
136 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 135 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
137 ExtensionBrowserTest::SetUpCommandLine(command_line); 136 ExtensionBrowserTest::SetUpCommandLine(command_line);
138 #if defined(OS_CHROMEOS) 137 #if defined(OS_CHROMEOS)
139 // ExtensionBrowserTest sets the login users to a non-managed value; 138 // ExtensionBrowserTest sets the login users to a non-managed value;
140 // replace it. This is the default username sent in policy blobs from the 139 // replace it. This is the default username sent in policy blobs from the
141 // testserver. 140 // testserver.
142 command_line->AppendSwitchASCII( 141 command_line->AppendSwitchASCII(switches::kLoginUser, "user@example.com");
143 chromeos::switches::kLoginUser, "user@example.com");
144 #endif 142 #endif
145 } 143 }
146 144
147 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 145 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
148 test_server_.RegisterClient(kDMToken, kDeviceID); 146 test_server_.RegisterClient(kDMToken, kDeviceID);
149 EXPECT_TRUE(test_server_.UpdatePolicyData( 147 EXPECT_TRUE(test_server_.UpdatePolicyData(
150 dm_protocol::kChromeExtensionPolicyType, kTestExtension, kTestPolicy)); 148 dm_protocol::kChromeExtensionPolicyType, kTestExtension, kTestPolicy));
151 ASSERT_TRUE(test_server_.Start()); 149 ASSERT_TRUE(test_server_.Start());
152 150
153 std::string url = test_server_.GetServiceURL().spec(); 151 std::string url = test_server_.GetServiceURL().spec();
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 ASSERT_EQ(kTestExtension2, extension2->id()); 319 ASSERT_EQ(kTestExtension2, extension2->id());
322 320
323 // This extension only sends the 'policy' signal once it receives the policy, 321 // This extension only sends the 'policy' signal once it receives the policy,
324 // and after verifying it has the expected value. Otherwise it sends 'fail'. 322 // and after verifying it has the expected value. Otherwise it sends 'fail'.
325 EXPECT_TRUE(result_listener.WaitUntilSatisfied()); 323 EXPECT_TRUE(result_listener.WaitUntilSatisfied());
326 } 324 }
327 325
328 #endif // OS_CHROMEOS 326 #endif // OS_CHROMEOS
329 327
330 } // namespace policy 328 } // namespace policy
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/policy/browser_policy_connector.cc ('k') | trunk/src/chrome/browser/profiles/profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698