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

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

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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
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 "chrome/test/base/web_ui_browser_test.h" 5 #include "chrome/test/base/web_ui_browser_test.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 const std::string& function_name, 119 const std::string& function_name,
120 const ConstValueVector& function_arguments) { 120 const ConstValueVector& function_arguments) {
121 return RunJavascriptUsingHandler( 121 return RunJavascriptUsingHandler(
122 function_name, function_arguments, false, false, NULL); 122 function_name, function_arguments, false, false, NULL);
123 } 123 }
124 124
125 bool WebUIBrowserTest::RunJavascriptTestF(bool is_async, 125 bool WebUIBrowserTest::RunJavascriptTestF(bool is_async,
126 const std::string& test_fixture, 126 const std::string& test_fixture,
127 const std::string& test_name) { 127 const std::string& test_name) {
128 ConstValueVector args; 128 ConstValueVector args;
129 args.push_back(new base::StringValue(test_fixture)); 129 args.push_back(new base::Value(test_fixture));
130 args.push_back(new base::StringValue(test_name)); 130 args.push_back(new base::Value(test_name));
131 131
132 if (is_async) 132 if (is_async)
133 return RunJavascriptAsyncTest("RUN_TEST_F", args); 133 return RunJavascriptAsyncTest("RUN_TEST_F", args);
134 else 134 else
135 return RunJavascriptTest("RUN_TEST_F", args); 135 return RunJavascriptTest("RUN_TEST_F", args);
136 } 136 }
137 137
138 bool WebUIBrowserTest::RunJavascriptTest(const std::string& test_name) { 138 bool WebUIBrowserTest::RunJavascriptTest(const std::string& test_name) {
139 ConstValueVector empty_args; 139 ConstValueVector empty_args;
140 return RunJavascriptTest(test_name, empty_args); 140 return RunJavascriptTest(test_name, empty_args);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 const ConstValueVector& test_arguments) { 200 const ConstValueVector& test_arguments) {
201 return RunJavascriptUsingHandler(test_name, test_arguments, true, true, NULL); 201 return RunJavascriptUsingHandler(test_name, test_arguments, true, true, NULL);
202 } 202 }
203 203
204 void WebUIBrowserTest::PreLoadJavascriptLibraries( 204 void WebUIBrowserTest::PreLoadJavascriptLibraries(
205 const std::string& preload_test_fixture, 205 const std::string& preload_test_fixture,
206 const std::string& preload_test_name, 206 const std::string& preload_test_name,
207 RenderViewHost* preload_host) { 207 RenderViewHost* preload_host) {
208 ASSERT_FALSE(libraries_preloaded_); 208 ASSERT_FALSE(libraries_preloaded_);
209 ConstValueVector args; 209 ConstValueVector args;
210 args.push_back(new base::StringValue(preload_test_fixture)); 210 args.push_back(new base::Value(preload_test_fixture));
211 args.push_back(new base::StringValue(preload_test_name)); 211 args.push_back(new base::Value(preload_test_name));
212 RunJavascriptUsingHandler( 212 RunJavascriptUsingHandler(
213 "preloadJavascriptLibraries", args, false, false, preload_host); 213 "preloadJavascriptLibraries", args, false, false, preload_host);
214 libraries_preloaded_ = true; 214 libraries_preloaded_ = true;
215 } 215 }
216 216
217 void WebUIBrowserTest::BrowsePreload(const GURL& browse_to) { 217 void WebUIBrowserTest::BrowsePreload(const GURL& browse_to) {
218 content::WebContents* web_contents = 218 content::WebContents* web_contents =
219 browser()->tab_strip_model()->GetActiveWebContents(); 219 browser()->tab_strip_model()->GetActiveWebContents();
220 WebUIJsInjectionReadyObserver injection_observer( 220 WebUIJsInjectionReadyObserver injection_observer(
221 web_contents, this, preload_test_fixture_, preload_test_name_); 221 web_contents, this, preload_test_fixture_, preload_test_name_);
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 } 489 }
490 490
491 GURL WebUIBrowserTest::WebUITestDataPathToURL( 491 GURL WebUIBrowserTest::WebUITestDataPathToURL(
492 const base::FilePath::StringType& path) { 492 const base::FilePath::StringType& path) {
493 base::FilePath dir_test_data; 493 base::FilePath dir_test_data;
494 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); 494 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data));
495 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path)); 495 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path));
496 EXPECT_TRUE(base::PathExists(test_path)); 496 EXPECT_TRUE(base::PathExists(test_path));
497 return net::FilePathToFileURL(test_path); 497 return net::FilePathToFileURL(test_path);
498 } 498 }
OLDNEW
« no previous file with comments | « chrome/test/base/javascript_browser_test.cc ('k') | chrome/test/base/web_ui_browser_test_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698