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

Unified Diff: content/renderer/render_view_browsertest_mac.mm

Issue 1123783002: Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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: content/renderer/render_view_browsertest_mac.mm
diff --git a/content/renderer/render_view_browsertest_mac.mm b/content/renderer/render_view_browsertest_mac.mm
index 6730da746aacfa6c84aade51397e0e32dfb65add..a973c313c4ecdc2b9096de0f0fc395bb222e96d2 100644
--- a/content/renderer/render_view_browsertest_mac.mm
+++ b/content/renderer/render_view_browsertest_mac.mm
@@ -103,7 +103,7 @@ TEST_F(RenderViewTest, MacTestCmdUp) {
EditCommands(1, EditCommand("moveToEndOfDocument", "")));
SendNativeKeyEvent(NativeWebKeyboardEvent(arrowDownKeyDown));
ProcessPendingMessages();
- ExecuteJavaScript("scroll.textContent = window.pageYOffset");
+ ExecuteJavaScriptForTests("scroll.textContent = window.pageYOffset");
output = GetMainFrame()->contentAsText(kMaxOutputCharacters);
EXPECT_EQ(kArrowDownScrollDown, base::UTF16ToASCII(output));
@@ -112,21 +112,21 @@ TEST_F(RenderViewTest, MacTestCmdUp) {
EditCommands(1, EditCommand("moveToBeginningOfDocument", "")));
SendNativeKeyEvent(NativeWebKeyboardEvent(arrowUpKeyDown));
ProcessPendingMessages();
- ExecuteJavaScript("scroll.textContent = window.pageYOffset");
+ ExecuteJavaScriptForTests("scroll.textContent = window.pageYOffset");
output = GetMainFrame()->contentAsText(kMaxOutputCharacters);
EXPECT_EQ(kArrowUpScrollUp, base::UTF16ToASCII(output));
// Now let javascript eat the key events -- no scrolling should happen.
// Set a scroll position slightly down the page to ensure that it does not
// move.
- ExecuteJavaScript("allowKeyEvents = false; window.scrollTo(0, 100)");
+ ExecuteJavaScriptForTests("allowKeyEvents = false; window.scrollTo(0, 100)");
const char* kArrowDownNoScroll = "40,false,false,true,false\n100\np1";
view->OnSetEditCommandsForNextKeyEvent(
EditCommands(1, EditCommand("moveToEndOfDocument", "")));
SendNativeKeyEvent(NativeWebKeyboardEvent(arrowDownKeyDown));
ProcessPendingMessages();
- ExecuteJavaScript("scroll.textContent = window.pageYOffset");
+ ExecuteJavaScriptForTests("scroll.textContent = window.pageYOffset");
output = GetMainFrame()->contentAsText(kMaxOutputCharacters);
EXPECT_EQ(kArrowDownNoScroll, base::UTF16ToASCII(output));
@@ -135,7 +135,7 @@ TEST_F(RenderViewTest, MacTestCmdUp) {
EditCommands(1, EditCommand("moveToBeginningOfDocument", "")));
SendNativeKeyEvent(NativeWebKeyboardEvent(arrowUpKeyDown));
ProcessPendingMessages();
- ExecuteJavaScript("scroll.textContent = window.pageYOffset");
+ ExecuteJavaScriptForTests("scroll.textContent = window.pageYOffset");
output = GetMainFrame()->contentAsText(kMaxOutputCharacters);
EXPECT_EQ(kArrowUpNoScroll, base::UTF16ToASCII(output));
}
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | extensions/browser/api/system_storage/system_storage_eject_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698