OLD | NEW |
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/javascript_browser_test.h" | 5 #include "chrome/test/base/javascript_browser_test.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
10 #include "content/public/browser/web_ui.h" | 10 #include "content/public/browser/web_ui.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 library_content.append("\n"); | 99 library_content.append("\n"); |
100 libraries->push_back(base::UTF8ToUTF16(library_content)); | 100 libraries->push_back(base::UTF8ToUTF16(library_content)); |
101 } | 101 } |
102 } | 102 } |
103 | 103 |
104 base::string16 JavaScriptBrowserTest::BuildRunTestJSCall( | 104 base::string16 JavaScriptBrowserTest::BuildRunTestJSCall( |
105 bool is_async, | 105 bool is_async, |
106 const std::string& function_name, | 106 const std::string& function_name, |
107 const ConstValueVector& test_func_args) { | 107 const ConstValueVector& test_func_args) { |
108 ConstValueVector arguments; | 108 ConstValueVector arguments; |
109 base::FundamentalValue* is_async_arg = new base::FundamentalValue(is_async); | 109 base::Value* is_async_arg = new base::Value(is_async); |
110 arguments.push_back(is_async_arg); | 110 arguments.push_back(is_async_arg); |
111 base::StringValue* function_name_arg = new base::StringValue(function_name); | 111 base::StringValue* function_name_arg = new base::StringValue(function_name); |
112 arguments.push_back(function_name_arg); | 112 arguments.push_back(function_name_arg); |
113 base::ListValue* baked_argument_list = new base::ListValue(); | 113 base::ListValue* baked_argument_list = new base::ListValue(); |
114 ConstValueVector::const_iterator arguments_iterator; | 114 ConstValueVector::const_iterator arguments_iterator; |
115 for (auto* arg : test_func_args) | 115 for (auto* arg : test_func_args) |
116 baked_argument_list->Append(arg->CreateDeepCopy()); | 116 baked_argument_list->Append(arg->CreateDeepCopy()); |
117 arguments.push_back(baked_argument_list); | 117 arguments.push_back(baked_argument_list); |
118 return content::WebUI::GetJavascriptCall(std::string("runTest"), | 118 return content::WebUI::GetJavascriptCall(std::string("runTest"), |
119 arguments.get()); | 119 arguments.get()); |
120 } | 120 } |
OLD | NEW |