Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1616)

Unified Diff: chrome/browser/extensions/extension_devtools_browsertests.cc

Issue 10795090: Move ExecuteJavaScript functions from ui_test_utils.h to browser_test_utils.h so they can be reused… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_devtools_browsertests.cc
===================================================================
--- chrome/browser/extensions/extension_devtools_browsertests.cc (revision 148111)
+++ chrome/browser/extensions/extension_devtools_browsertests.cc (working copy)
@@ -23,6 +23,7 @@
#include "content/public/browser/devtools_manager.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/test/browser_test_utils.h"
#include "net/base/net_util.h"
using content::DevToolsAgentHost;
@@ -78,7 +79,7 @@
bool result = false;
std::wstring register_listeners_js = base::StringPrintf(
L"setListenersOnTab(%d)", tab_id);
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
host->render_view_host(), L"", register_listeners_js, &result));
EXPECT_TRUE(result);
@@ -94,7 +95,7 @@
result = false;
devtools_client_host->DispatchOnInspectorFrontend("");
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
host->render_view_host(), L"", L"testReceivePageEvent()", &result));
EXPECT_TRUE(result);
@@ -103,7 +104,7 @@
devtools_manager->UnregisterDevToolsClientHostFor(
DevToolsAgentHostRegistry::GetDevToolsAgentHost(
web_contents->GetRenderViewHost()));
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
host->render_view_host(), L"", L"testReceiveTabCloseEvent()", &result));
EXPECT_TRUE(result);
}
@@ -137,7 +138,7 @@
bool result = false;
std::wstring register_listeners_js = base::StringPrintf(
L"setListenersOnTab(%d)", tab_id);
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
host_one->render_view_host(), L"", register_listeners_js, &result));
EXPECT_TRUE(result);
@@ -150,14 +151,14 @@
// Register listeners from the second extension as well.
std::wstring script = base::StringPrintf(L"registerListenersForTab(%d)",
tab_id);
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
host_two->render_view_host(), L"", script, &result));
EXPECT_TRUE(result);
// Removing the listeners from the first extension should leave the bridge
// alive.
result = false;
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
host_one->render_view_host(), L"", L"unregisterListeners()", &result));
EXPECT_TRUE(result);
ASSERT_TRUE(devtools_manager->GetDevToolsClientHostFor(
@@ -167,7 +168,7 @@
// Removing the listeners from the second extension should tear the bridge
// down.
result = false;
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
host_two->render_view_host(), L"", L"unregisterListeners()", &result));
EXPECT_TRUE(result);
ASSERT_FALSE(devtools_manager->GetDevToolsClientHostFor(
« no previous file with comments | « chrome/browser/extensions/extension_browsertest.cc ('k') | chrome/browser/extensions/extension_dom_clipboard_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698