OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } // namespace | 51 } // namespace |
52 | 52 |
53 class UserCloudPolicyManagerTest : public chromeos::OobeBaseTest { | 53 class UserCloudPolicyManagerTest : public chromeos::OobeBaseTest { |
54 protected: | 54 protected: |
55 UserCloudPolicyManagerTest() { | 55 UserCloudPolicyManagerTest() { |
56 set_open_about_blank_on_browser_launch(false); | 56 set_open_about_blank_on_browser_launch(false); |
57 } | 57 } |
58 | 58 |
59 virtual ~UserCloudPolicyManagerTest() {} | 59 virtual ~UserCloudPolicyManagerTest() {} |
60 | 60 |
61 virtual void SetUp() OVERRIDE { | 61 virtual void SetUp() override { |
62 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 62 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
63 SetServerPolicy(); | 63 SetServerPolicy(); |
64 | 64 |
65 test_server_.reset(new LocalPolicyTestServer(policy_file_path())); | 65 test_server_.reset(new LocalPolicyTestServer(policy_file_path())); |
66 ASSERT_TRUE(test_server_->Start()); | 66 ASSERT_TRUE(test_server_->Start()); |
67 | 67 |
68 OobeBaseTest::SetUp(); | 68 OobeBaseTest::SetUp(); |
69 } | 69 } |
70 | 70 |
71 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 71 virtual void SetUpCommandLine(CommandLine* command_line) override { |
72 command_line->AppendSwitchASCII(policy::switches::kDeviceManagementUrl, | 72 command_line->AppendSwitchASCII(policy::switches::kDeviceManagementUrl, |
73 test_server_->GetServiceURL().spec()); | 73 test_server_->GetServiceURL().spec()); |
74 OobeBaseTest::SetUpCommandLine(command_line); | 74 OobeBaseTest::SetUpCommandLine(command_line); |
75 } | 75 } |
76 | 76 |
77 virtual void SetUpOnMainThread() OVERRIDE { | 77 virtual void SetUpOnMainThread() override { |
78 SetMergeSessionParams(kAccountId); | 78 SetMergeSessionParams(kAccountId); |
79 SetupGaiaServerWithAccessTokens(); | 79 SetupGaiaServerWithAccessTokens(); |
80 OobeBaseTest::SetUpOnMainThread(); | 80 OobeBaseTest::SetUpOnMainThread(); |
81 } | 81 } |
82 | 82 |
83 void SetupGaiaServerWithAccessTokens() { | 83 void SetupGaiaServerWithAccessTokens() { |
84 FakeGaia::AccessTokenInfo token_info; | 84 FakeGaia::AccessTokenInfo token_info; |
85 token_info.token = kTestUserinfoToken; | 85 token_info.token = kTestUserinfoToken; |
86 token_info.scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth); | 86 token_info.scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth); |
87 token_info.scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope); | 87 token_info.scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 ASSERT_TRUE(tabs); | 178 ASSERT_TRUE(tabs); |
179 const int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); | 179 const int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); |
180 EXPECT_EQ(expected_tab_count, tabs->count()); | 180 EXPECT_EQ(expected_tab_count, tabs->count()); |
181 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) { | 181 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) { |
182 EXPECT_EQ(GURL(kStartupURLs[i]), | 182 EXPECT_EQ(GURL(kStartupURLs[i]), |
183 tabs->GetWebContentsAt(i)->GetVisibleURL()); | 183 tabs->GetWebContentsAt(i)->GetVisibleURL()); |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
187 } // namespace policy | 187 } // namespace policy |
OLD | NEW |