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

Unified Diff: content/public/test/browser_test_utils.cc

Issue 330113002: Fixing flaky overscroll and touch exploration mode browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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/public/test/browser_test_utils.h ('k') | content/public/test/test_navigation_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_utils.cc
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index 5beaa363675cf20374b662621f684746ce971859..0a07dc17482004426adc50e6a78543cde3a4ee10 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -34,7 +34,11 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/aura/window.h"
+#include "ui/aura/window_event_dispatcher.h"
+#include "ui/aura/window_tree_host.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/compositor/test/draw_waiter_for_test.h"
#include "ui/events/gestures/gesture_configuration.h"
#include "ui/events/keycodes/dom4/keycode_converter.h"
@@ -208,9 +212,9 @@ void WaitForLoadStop(WebContents* web_contents) {
Source<NavigationController>(&web_contents->GetController()));
// In many cases, the load may have finished before we get here. Only wait if
// the tab still has a pending navigation.
- if (!web_contents->IsLoading())
- return;
- load_stop_observer.Wait();
+ if (web_contents->IsLoading())
+ load_stop_observer.Wait();
+ WaitForResizeComplete(web_contents);
}
void CrashTab(WebContents* web_contents) {
@@ -221,6 +225,27 @@ void CrashTab(WebContents* web_contents) {
watcher.Wait();
}
+void WaitForResizeComplete(WebContents* web_contents) {
+ LOG(ERROR) << "WaitForResizeToComplete";
+ LOG(ERROR) << "web_contents=" << web_contents;
+ aura::Window* content = web_contents->GetContentNativeView();
+ LOG(ERROR) << 1;
+ LOG(ERROR) << "content=" << content;
+ if (content) {
+ aura::WindowTreeHost* host = content->GetHost();
+ LOG(ERROR) << 2;
+ aura::WindowEventDispatcher* dispatcher = host->dispatcher();
+ LOG(ERROR) << 3;
+ while (dispatcher->HoldingPointerMovesForTest()) {
+ LOG(ERROR) << "HoldingPointerMovesForTest";
+ ui::DrawWaiterForTest::WaitForCommit(host->compositor());
+ LOG(ERROR) << "WaitForCommit done";
+ LOG(ERROR) << "dispatcher->HoldingPointerMovesForTest()="
+ << dispatcher->HoldingPointerMovesForTest();
+ }
+ }
+}
+
sadrul 2014/06/12 23:25:51 Could this work with RenderWidgetHostImpl::resize_
mfomitchev 2014/06/13 15:20:57 Done.
void SimulateMouseClick(WebContents* web_contents,
int modifiers,
blink::WebMouseEvent::Button button) {
« no previous file with comments | « content/public/test/browser_test_utils.h ('k') | content/public/test/test_navigation_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698