OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 } | 242 } |
243 | 243 |
244 private: | 244 private: |
245 DISALLOW_COPY_AND_ASSIGN(DataProxyScriptBrowserTest); | 245 DISALLOW_COPY_AND_ASSIGN(DataProxyScriptBrowserTest); |
246 }; | 246 }; |
247 | 247 |
248 IN_PROC_BROWSER_TEST_F(DataProxyScriptBrowserTest, Verify) { | 248 IN_PROC_BROWSER_TEST_F(DataProxyScriptBrowserTest, Verify) { |
249 VerifyProxyScript(browser()); | 249 VerifyProxyScript(browser()); |
250 } | 250 } |
251 | 251 |
| 252 // Fetch PAC script via a data: URL and run out-of-process using Mojo. |
| 253 class OutOfProcessProxyResolverBrowserTest : public InProcessBrowserTest { |
| 254 public: |
| 255 OutOfProcessProxyResolverBrowserTest() {} |
| 256 ~OutOfProcessProxyResolverBrowserTest() override {} |
| 257 |
| 258 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 259 std::string contents; |
| 260 // Read in kPACScript contents. |
| 261 ASSERT_TRUE(base::ReadFileToString(ui_test_utils::GetTestFilePath( |
| 262 base::FilePath(base::FilePath::kCurrentDirectory), |
| 263 base::FilePath(kPACScript)), |
| 264 &contents)); |
| 265 command_line->AppendSwitchASCII( |
| 266 switches::kProxyPacUrl, "data:," + contents); |
| 267 command_line->AppendSwitch(switches::kV8PacMojoOutOfProcess); |
| 268 } |
| 269 |
| 270 private: |
| 271 DISALLOW_COPY_AND_ASSIGN(OutOfProcessProxyResolverBrowserTest); |
| 272 }; |
| 273 |
| 274 IN_PROC_BROWSER_TEST_F(OutOfProcessProxyResolverBrowserTest, Verify) { |
| 275 VerifyProxyScript(browser()); |
| 276 } |
| 277 |
252 } // namespace | 278 } // namespace |
OLD | NEW |