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

Side by Side Diff: chrome/browser/ui/webui/web_ui_test_handler.cc

Issue 10822030: Move ui_test_utils::RunMessageLoop to test_utils so that it can be reused by content_browsertests. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/web_ui_test_handler.h" 5 #include "chrome/browser/ui/webui/web_ui_test_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 99
100 bool WebUITestHandler::WaitForResult() { 100 bool WebUITestHandler::WaitForResult() {
101 SCOPED_TRACE("WebUITestHandler::WaitForResult"); 101 SCOPED_TRACE("WebUITestHandler::WaitForResult");
102 test_done_ = false; 102 test_done_ = false;
103 run_test_done_ = false; 103 run_test_done_ = false;
104 is_waiting_ = true; 104 is_waiting_ = true;
105 105
106 // Either sync test completion or the testDone() will cause message loop 106 // Either sync test completion or the testDone() will cause message loop
107 // to quit. 107 // to quit.
108 ui_test_utils::RunMessageLoop(); 108 content::RunMessageLoop();
109 109
110 // Run a second message loop when not |run_test_done_| so that the sync test 110 // Run a second message loop when not |run_test_done_| so that the sync test
111 // completes, or |run_test_succeeded_| but not |test_done_| so async tests 111 // completes, or |run_test_succeeded_| but not |test_done_| so async tests
112 // complete. 112 // complete.
113 if (!run_test_done_ || (run_test_succeeded_ && !test_done_)) { 113 if (!run_test_done_ || (run_test_succeeded_ && !test_done_)) {
114 ui_test_utils::RunMessageLoop(); 114 content::RunMessageLoop();
115 } 115 }
116 116
117 is_waiting_ = false; 117 is_waiting_ = false;
118 118
119 // To succeed the test must execute as well as pass the test. 119 // To succeed the test must execute as well as pass the test.
120 return run_test_succeeded_ && test_succeeded_; 120 return run_test_succeeded_ && test_succeeded_;
121 } 121 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/web_ui_browsertest.cc ('k') | chrome/test/base/in_process_browser_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698