summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/tools/test_shell/test_shell_gtk.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc
index 8cc9214..bcf4ec0 100644
--- a/webkit/tools/test_shell/test_shell_gtk.cc
+++ b/webkit/tools/test_shell/test_shell_gtk.cc
@@ -506,13 +506,6 @@ void TestShell::ResizeSubViews() {
GtkWindow* window = *(TestShell::windowList()->begin());
TestShell* shell =
static_cast<TestShell*>(g_object_get_data(G_OBJECT(window), "test-shell"));
- shell->ResetTestController();
-
- // ResetTestController may have closed the window we were holding on to.
- // Grab the first window again.
- window = *(TestShell::windowList()->begin());
- shell = static_cast<TestShell*>(g_object_get_data(G_OBJECT(window), "test-shell"));
- DCHECK(shell);
// Clear focus between tests.
shell->m_focusedWidgetHost = NULL;
@@ -521,6 +514,18 @@ void TestShell::ResizeSubViews() {
shell->webView()->mainFrame()->stopLoading();
shell->navigation_controller()->Reset();
+ // StopLoading may update state maintained in the test controller (for
+ // example, whether the WorkQueue is frozen) as such, we need to reset it
+ // after we invoke StopLoading.
+ shell->ResetTestController();
+
+ // ResetTestController may have closed the window we were holding on to.
+ // Grab the first window again.
+ window = *(TestShell::windowList()->begin());
+ shell = static_cast<TestShell*>(g_object_get_data(G_OBJECT(window),
+ "test-shell"));
+ DCHECK(shell);
+
// Clean up state between test runs.
webkit_glue::ResetBeforeTestRun(shell->webView());
ResetWebPreferences();