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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 bool IsJavascriptEnabled(content::WebContents* contents) { | 371 bool IsJavascriptEnabled(content::WebContents* contents) { |
372 scoped_ptr<base::Value> value = content::ExecuteScriptAndGetValue( | 372 scoped_ptr<base::Value> value = content::ExecuteScriptAndGetValue( |
373 contents->GetMainFrame(), "123"); | 373 contents->GetMainFrame(), "123"); |
374 int result = 0; | 374 int result = 0; |
375 if (!value->GetAsInteger(&result)) | 375 if (!value->GetAsInteger(&result)) |
376 EXPECT_EQ(base::Value::TYPE_NULL, value->GetType()); | 376 EXPECT_EQ(base::Value::TYPE_NULL, value->GetType()); |
377 return result == 123; | 377 return result == 123; |
378 } | 378 } |
379 | 379 |
380 bool IsNetworkPredictionEnabled(PrefService* prefs) { | 380 bool IsNetworkPredictionEnabled(PrefService* prefs) { |
381 return chrome_browser_net::CanPredictNetworkActionsUI(prefs); | 381 return chrome_browser_net::CanPrefetchAndPrerenderUI(prefs); |
382 } | 382 } |
383 | 383 |
384 void CopyPluginListAndQuit(std::vector<content::WebPluginInfo>* out, | 384 void CopyPluginListAndQuit(std::vector<content::WebPluginInfo>* out, |
385 const std::vector<content::WebPluginInfo>& in) { | 385 const std::vector<content::WebPluginInfo>& in) { |
386 *out = in; | 386 *out = in; |
387 base::MessageLoop::current()->QuitWhenIdle(); | 387 base::MessageLoop::current()->QuitWhenIdle(); |
388 } | 388 } |
389 | 389 |
390 template<typename T> | 390 template<typename T> |
391 void CopyValueAndQuit(T* out, T in) { | 391 void CopyValueAndQuit(T* out, T in) { |
(...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3213 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3213 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
3214 browser2->tab_strip_model()->GetActiveWebContents(), | 3214 browser2->tab_strip_model()->GetActiveWebContents(), |
3215 "domAutomationController.send(window.showModalDialog !== undefined);", | 3215 "domAutomationController.send(window.showModalDialog !== undefined);", |
3216 &result)); | 3216 &result)); |
3217 EXPECT_TRUE(result); | 3217 EXPECT_TRUE(result); |
3218 } | 3218 } |
3219 | 3219 |
3220 #endif // !defined(CHROME_OS) | 3220 #endif // !defined(CHROME_OS) |
3221 | 3221 |
3222 } // namespace policy | 3222 } // namespace policy |
OLD | NEW |