OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 66 } |
67 | 67 |
68 } // namespace | 68 } // namespace |
69 | 69 |
70 class ArcRobotAuthCodeFetcherBrowserTest : public InProcessBrowserTest { | 70 class ArcRobotAuthCodeFetcherBrowserTest : public InProcessBrowserTest { |
71 protected: | 71 protected: |
72 ArcRobotAuthCodeFetcherBrowserTest() = default; | 72 ArcRobotAuthCodeFetcherBrowserTest() = default; |
73 ~ArcRobotAuthCodeFetcherBrowserTest() override = default; | 73 ~ArcRobotAuthCodeFetcherBrowserTest() override = default; |
74 | 74 |
75 void SetUpCommandLine(base::CommandLine* command_line) override { | 75 void SetUpCommandLine(base::CommandLine* command_line) override { |
76 InProcessBrowserTest::SetUpCommandLine(command_line); | |
77 command_line->AppendSwitchASCII(policy::switches::kDeviceManagementUrl, | 76 command_line->AppendSwitchASCII(policy::switches::kDeviceManagementUrl, |
78 "http://localhost"); | 77 "http://localhost"); |
79 arc::SetArcAvailableCommandLineForTesting(command_line); | 78 arc::SetArcAvailableCommandLineForTesting(command_line); |
80 } | 79 } |
81 | 80 |
82 void SetUpOnMainThread() override { | 81 void SetUpOnMainThread() override { |
83 interceptor_ = base::MakeUnique<policy::TestRequestInterceptor>( | 82 interceptor_ = base::MakeUnique<policy::TestRequestInterceptor>( |
84 "localhost", content::BrowserThread::GetTaskRunnerForThread( | 83 "localhost", content::BrowserThread::GetTaskRunnerForThread( |
85 content::BrowserThread::IO)); | 84 content::BrowserThread::IO)); |
86 | 85 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 174 |
176 auto robot_fetcher = base::MakeUnique<ArcRobotAuthCodeFetcher>(); | 175 auto robot_fetcher = base::MakeUnique<ArcRobotAuthCodeFetcher>(); |
177 FetchAuthCode(robot_fetcher.get(), &fetch_success, &auth_code); | 176 FetchAuthCode(robot_fetcher.get(), &fetch_success, &auth_code); |
178 | 177 |
179 EXPECT_FALSE(fetch_success); | 178 EXPECT_FALSE(fetch_success); |
180 // Use EXPECT_EQ for better logging in case of failure. | 179 // Use EXPECT_EQ for better logging in case of failure. |
181 EXPECT_EQ(std::string(), auth_code); | 180 EXPECT_EQ(std::string(), auth_code); |
182 } | 181 } |
183 | 182 |
184 } // namespace arc | 183 } // namespace arc |
OLD | NEW |