| 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 "chrome/browser/ui/webui/options/preferences_browsertest.h" | 5 #include "chrome/browser/ui/webui/options/preferences_browsertest.h" |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 GURL(chrome::kChromeUISettingsFrameURL)); | 83 GURL(chrome::kChromeUISettingsFrameURL)); |
| 84 SetUpPrefs(); | 84 SetUpPrefs(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void PreferencesBrowserTest::SetUpPrefs() { | 87 void PreferencesBrowserTest::SetUpPrefs() { |
| 88 content::WebContents* web_contents = | 88 content::WebContents* web_contents = |
| 89 browser()->tab_strip_model()->GetActiveWebContents(); | 89 browser()->tab_strip_model()->GetActiveWebContents(); |
| 90 ASSERT_TRUE(web_contents); | 90 ASSERT_TRUE(web_contents); |
| 91 render_view_host_ = web_contents->GetRenderViewHost(); | 91 render_view_host_ = web_contents->GetRenderViewHost(); |
| 92 ASSERT_TRUE(render_view_host_); | 92 ASSERT_TRUE(render_view_host_); |
| 93 pref_change_registrar_.Init(components::UserPrefs::Get(browser()->profile())); | 93 pref_change_registrar_.Init(user_prefs::UserPrefs::Get(browser()->profile())); |
| 94 pref_service_ = browser()->profile()->GetPrefs(); | 94 pref_service_ = browser()->profile()->GetPrefs(); |
| 95 ASSERT_TRUE(content::ExecuteScript(render_view_host_, | 95 ASSERT_TRUE(content::ExecuteScript(render_view_host_, |
| 96 "function TestEnv() {" | 96 "function TestEnv() {" |
| 97 " this.sentinelName_ = 'download.prompt_for_download';" | 97 " this.sentinelName_ = 'download.prompt_for_download';" |
| 98 " this.prefs_ = [];" | 98 " this.prefs_ = [];" |
| 99 " TestEnv.instance_ = this;" | 99 " TestEnv.instance_ = this;" |
| 100 "}" | 100 "}" |
| 101 "" | 101 "" |
| 102 "TestEnv.handleEvent = function(event) {" | 102 "TestEnv.handleEvent = function(event) {" |
| 103 " var env = TestEnv.instance_;" | 103 " var env = TestEnv.instance_;" |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 SetProxyPref(chromeos::kProxyHttpPort, base::FundamentalValue(1)); | 830 SetProxyPref(chromeos::kProxyHttpPort, base::FundamentalValue(1)); |
| 831 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2)); | 831 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2)); |
| 832 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3)); | 832 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3)); |
| 833 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4)); | 833 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4)); |
| 834 | 834 |
| 835 VerifyCurrentProxyServer( | 835 VerifyCurrentProxyServer( |
| 836 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4"); | 836 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4"); |
| 837 } | 837 } |
| 838 | 838 |
| 839 #endif | 839 #endif |
| OLD | NEW |