| 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/path_service.h" | 6 #include "base/path_service.h" | 
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" | 
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" | 
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" | 
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" | 
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 228 | 228 | 
| 229 // Fetch PAC script via a data: URL. | 229 // Fetch PAC script via a data: URL. | 
| 230 class DataProxyScriptBrowserTest : public InProcessBrowserTest { | 230 class DataProxyScriptBrowserTest : public InProcessBrowserTest { | 
| 231  public: | 231  public: | 
| 232   DataProxyScriptBrowserTest() {} | 232   DataProxyScriptBrowserTest() {} | 
| 233   virtual ~DataProxyScriptBrowserTest() {} | 233   virtual ~DataProxyScriptBrowserTest() {} | 
| 234 | 234 | 
| 235   virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 235   virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 
| 236     std::string contents; | 236     std::string contents; | 
| 237     // Read in kPACScript contents. | 237     // Read in kPACScript contents. | 
| 238     ASSERT_TRUE(file_util::ReadFileToString(ui_test_utils::GetTestFilePath( | 238     ASSERT_TRUE(base::ReadFileToString(ui_test_utils::GetTestFilePath( | 
| 239         base::FilePath(base::FilePath::kCurrentDirectory), | 239         base::FilePath(base::FilePath::kCurrentDirectory), | 
| 240         base::FilePath(kPACScript)), | 240         base::FilePath(kPACScript)), | 
| 241         &contents)); | 241         &contents)); | 
| 242     command_line->AppendSwitchASCII(switches::kProxyPacUrl, | 242     command_line->AppendSwitchASCII(switches::kProxyPacUrl, | 
| 243         std::string("data:,") + contents); | 243         std::string("data:,") + contents); | 
| 244   } | 244   } | 
| 245 | 245 | 
| 246  private: | 246  private: | 
| 247   DISALLOW_COPY_AND_ASSIGN(DataProxyScriptBrowserTest); | 247   DISALLOW_COPY_AND_ASSIGN(DataProxyScriptBrowserTest); | 
| 248 }; | 248 }; | 
| 249 | 249 | 
| 250 IN_PROC_BROWSER_TEST_F(DataProxyScriptBrowserTest, Verify) { | 250 IN_PROC_BROWSER_TEST_F(DataProxyScriptBrowserTest, Verify) { | 
| 251   VerifyProxyScript(browser()); | 251   VerifyProxyScript(browser()); | 
| 252 } | 252 } | 
| 253 | 253 | 
| 254 }  // namespace | 254 }  // namespace | 
| OLD | NEW | 
|---|