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

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

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 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
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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/memory/ref_counted_memory.h" 11 #include "base/memory/ref_counted_memory.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/utf_string_conversions.h"
14 #include "base/values.h" 15 #include "base/values.h"
15 #include "chrome/browser/chrome_content_browser_client.h" 16 #include "chrome/browser/chrome_content_browser_client.h"
16 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/browser.h" 18 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/browser_commands.h" 19 #include "chrome/browser/ui/browser_commands.h"
19 #include "chrome/browser/ui/tabs/tab_strip_model.h" 20 #include "chrome/browser/ui/tabs/tab_strip_model.h"
20 #include "chrome/browser/ui/webui/web_ui_test_handler.h" 21 #include "chrome/browser/ui/webui/web_ui_test_handler.h"
21 #include "chrome/common/chrome_paths.h" 22 #include "chrome/common/chrome_paths.h"
22 #include "chrome/common/url_constants.h" 23 #include "chrome/common/url_constants.h"
23 #include "chrome/test/base/test_chrome_web_ui_controller_factory.h" 24 #include "chrome/test/base/test_chrome_web_ui_controller_factory.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 bool is_async, 412 bool is_async,
412 RenderViewHost* preload_host) { 413 RenderViewHost* preload_host) {
413 // Get the user libraries. Preloading them individually is best, then 414 // Get the user libraries. Preloading them individually is best, then
414 // we can assign each one a filename for better stack traces. Otherwise 415 // we can assign each one a filename for better stack traces. Otherwise
415 // append them all to |content|. 416 // append them all to |content|.
416 base::string16 content; 417 base::string16 content;
417 std::vector<base::string16> libraries; 418 std::vector<base::string16> libraries;
418 if (!libraries_preloaded_) { 419 if (!libraries_preloaded_) {
419 BuildJavascriptLibraries(&libraries); 420 BuildJavascriptLibraries(&libraries);
420 if (!preload_host) { 421 if (!preload_host) {
421 content = JoinString(libraries, '\n'); 422 content = base::JoinString(libraries, base::ASCIIToUTF16("\n"));
422 libraries.clear(); 423 libraries.clear();
423 } 424 }
424 } 425 }
425 426
426 if (!function_name.empty()) { 427 if (!function_name.empty()) {
427 base::string16 called_function; 428 base::string16 called_function;
428 if (is_test) { 429 if (is_test) {
429 called_function = 430 called_function =
430 BuildRunTestJSCall(is_async, function_name, function_arguments); 431 BuildRunTestJSCall(is_async, function_name, function_arguments);
431 } else { 432 } else {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 } 476 }
476 477
477 GURL WebUIBrowserTest::WebUITestDataPathToURL( 478 GURL WebUIBrowserTest::WebUITestDataPathToURL(
478 const base::FilePath::StringType& path) { 479 const base::FilePath::StringType& path) {
479 base::FilePath dir_test_data; 480 base::FilePath dir_test_data;
480 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); 481 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data));
481 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path)); 482 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path));
482 EXPECT_TRUE(base::PathExists(test_path)); 483 EXPECT_TRUE(base::PathExists(test_path));
483 return net::FilePathToFileURL(test_path); 484 return net::FilePathToFileURL(test_path);
484 } 485 }
OLDNEW
« no previous file with comments | « chrome/test/base/extension_js_browser_test.cc ('k') | chrome/test/chromedriver/chrome_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698