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

Side by Side Diff: chrome/test/base/web_ui_browser_test_browsertest.cc

Issue 1995113002: Rename WebUI::CallJavascriptFunction to WebUI::CallJavascriptFunctionUnsafe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/voice_search_ui.cc ('k') | chrome/test/data/webui/async_gen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <string> 5 #include <string>
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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 base::Unretained(this))); 123 base::Unretained(this)));
124 web_ui()->RegisterMessageCallback("testPasses", 124 web_ui()->RegisterMessageCallback("testPasses",
125 base::Bind(&AsyncWebUIMessageHandler::HandleTestPasses, 125 base::Bind(&AsyncWebUIMessageHandler::HandleTestPasses,
126 base::Unretained(this))); 126 base::Unretained(this)));
127 } 127 }
128 128
129 // Starts the test in |list_value|[0] with the runAsync wrapper. 129 // Starts the test in |list_value|[0] with the runAsync wrapper.
130 void HandleStartAsyncTest(const base::ListValue* list_value) { 130 void HandleStartAsyncTest(const base::ListValue* list_value) {
131 const base::Value* test_name; 131 const base::Value* test_name;
132 ASSERT_TRUE(list_value->Get(0, &test_name)); 132 ASSERT_TRUE(list_value->Get(0, &test_name));
133 web_ui()->CallJavascriptFunction("runAsync", *test_name); 133 web_ui()->CallJavascriptFunctionUnsafe("runAsync", *test_name);
134 } 134 }
135 135
136 DISALLOW_COPY_AND_ASSIGN(AsyncWebUIMessageHandler); 136 DISALLOW_COPY_AND_ASSIGN(AsyncWebUIMessageHandler);
137 }; 137 };
138 138
139 // Handler for this object. 139 // Handler for this object.
140 ::testing::StrictMock<AsyncWebUIMessageHandler> message_handler_; 140 ::testing::StrictMock<AsyncWebUIMessageHandler> message_handler_;
141 141
142 private: 142 private:
143 // Provide this object's handler. 143 // Provide this object's handler.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // testDone directly and expect pass result. 239 // testDone directly and expect pass result.
240 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { 240 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) {
241 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); 241 ASSERT_TRUE(RunJavascriptAsyncTest("testDone"));
242 } 242 }
243 243
244 // Test that calling testDone during RunJavascriptTest still completes when 244 // Test that calling testDone during RunJavascriptTest still completes when
245 // waiting for async result. 245 // waiting for async result.
246 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { 246 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) {
247 ASSERT_TRUE(RunJavascriptTest("testDone")); 247 ASSERT_TRUE(RunJavascriptTest("testDone"));
248 } 248 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/voice_search_ui.cc ('k') | chrome/test/data/webui/async_gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698