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

Unified Diff: content/renderer/render_view_browsertest_mac.mm

Issue 2870633002: Use ScopedTaskEnvironment instead of MessageLoop in RenderViewTest. (Closed)
Patch Set: fix-build-error Created 3 years, 7 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
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bda9232067f0c35e8be53a414b0c2f98d54f91bc..bbd52eb6abc29f429eec6d3691a9c8e6d8692594 100644
--- a/content/renderer/render_view_browsertest_mac.mm
+++ b/content/renderer/render_view_browsertest_mac.mm
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/run_loop.h"
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -111,7 +112,7 @@ TEST_F(RenderViewTest, MacTestCmdUp) {
view->OnSetEditCommandsForNextKeyEvent(
EditCommands(1, EditCommand("moveToEndOfDocument", "")));
SendNativeKeyEvent(NativeWebKeyboardEvent(arrowDownKeyDown));
- ProcessPendingMessages();
+ base::RunLoop().RunUntilIdle();
ExecuteJavaScriptForTests("scroll.textContent = window.pageYOffset");
output = WebFrameContentDumper::DumpWebViewAsText(view->GetWebView(),
kMaxOutputCharacters)
@@ -122,7 +123,7 @@ TEST_F(RenderViewTest, MacTestCmdUp) {
view->OnSetEditCommandsForNextKeyEvent(
EditCommands(1, EditCommand("moveToBeginningOfDocument", "")));
SendNativeKeyEvent(NativeWebKeyboardEvent(arrowUpKeyDown));
- ProcessPendingMessages();
+ base::RunLoop().RunUntilIdle();
ExecuteJavaScriptForTests("scroll.textContent = window.pageYOffset");
output = WebFrameContentDumper::DumpWebViewAsText(view->GetWebView(),
kMaxOutputCharacters)
@@ -138,7 +139,7 @@ TEST_F(RenderViewTest, MacTestCmdUp) {
view->OnSetEditCommandsForNextKeyEvent(
EditCommands(1, EditCommand("moveToEndOfDocument", "")));
SendNativeKeyEvent(NativeWebKeyboardEvent(arrowDownKeyDown));
- ProcessPendingMessages();
+ base::RunLoop().RunUntilIdle();
ExecuteJavaScriptForTests("scroll.textContent = window.pageYOffset");
output = WebFrameContentDumper::DumpWebViewAsText(view->GetWebView(),
kMaxOutputCharacters)
@@ -149,7 +150,7 @@ TEST_F(RenderViewTest, MacTestCmdUp) {
view->OnSetEditCommandsForNextKeyEvent(
EditCommands(1, EditCommand("moveToBeginningOfDocument", "")));
SendNativeKeyEvent(NativeWebKeyboardEvent(arrowUpKeyDown));
- ProcessPendingMessages();
+ base::RunLoop().RunUntilIdle();
ExecuteJavaScriptForTests("scroll.textContent = window.pageYOffset");
output = WebFrameContentDumper::DumpWebViewAsText(view->GetWebView(),
kMaxOutputCharacters)
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698