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

Side by Side Diff: content/browser/webui/web_ui_test_handler.cc

Issue 6805003: Add a test for checking that refreshing a page does load the same WebUI page. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/webui/web_ui_test_handler.h" 5 #include "content/browser/webui/web_ui_test_handler.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/test/ui_test_utils.h" 9 #include "chrome/test/ui_test_utils.h"
10 #include "content/browser/renderer_host/render_view_host.h" 10 #include "content/browser/renderer_host/render_view_host.h"
(...skipping 15 matching lines...) Expand all
26 MessageLoopForUI::current()->Quit(); 26 MessageLoopForUI::current()->Quit();
27 } 27 }
28 28
29 void WebUITestHandler::HandleFail(const ListValue* args) { 29 void WebUITestHandler::HandleFail(const ListValue* args) {
30 test_succeeded_ = false; 30 test_succeeded_ = false;
31 if (is_waiting_) 31 if (is_waiting_)
32 MessageLoopForUI::current()->Quit(); 32 MessageLoopForUI::current()->Quit();
33 33
34 std::string message; 34 std::string message;
35 ASSERT_TRUE(args->GetString(0, &message)); 35 ASSERT_TRUE(args->GetString(0, &message));
36 LOG(INFO) << message; 36 LOG(ERROR) << message;
37 } 37 }
38 38
39 void WebUITestHandler::RegisterMessages() { 39 void WebUITestHandler::RegisterMessages() {
40 web_ui_->RegisterMessageCallback("Pass", 40 web_ui_->RegisterMessageCallback("Pass",
41 NewCallback(this, &WebUITestHandler::HandlePass)); 41 NewCallback(this, &WebUITestHandler::HandlePass));
42 web_ui_->RegisterMessageCallback("Fail", 42 web_ui_->RegisterMessageCallback("Fail",
43 NewCallback(this, &WebUITestHandler::HandleFail)); 43 NewCallback(this, &WebUITestHandler::HandleFail));
44 } 44 }
45 45
46 bool WebUITestHandler::WaitForResult() { 46 bool WebUITestHandler::WaitForResult() {
47 is_waiting_ = true; 47 is_waiting_ = true;
48 ui_test_utils::RunMessageLoop(); 48 ui_test_utils::RunMessageLoop();
49 is_waiting_ = false; 49 is_waiting_ = false;
50 return test_succeeded_; 50 return test_succeeded_;
51 } 51 }
OLDNEW
« chrome/test/data/webui/settings_util.js ('K') | « chrome/test/data/webui/test_api.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698