| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/nacl/nacl_browsertest_util.h" | 5 #include "chrome/test/nacl/nacl_browsertest_util.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 GURL NaClBrowserTestBase::TestURL( | 229 GURL NaClBrowserTestBase::TestURL( |
| 230 const base::FilePath::StringType& url_fragment) { | 230 const base::FilePath::StringType& url_fragment) { |
| 231 base::FilePath expanded_url = base::FilePath(FILE_PATH_LITERAL("files")); | 231 base::FilePath expanded_url = base::FilePath(FILE_PATH_LITERAL("files")); |
| 232 expanded_url = expanded_url.Append(url_fragment); | 232 expanded_url = expanded_url.Append(url_fragment); |
| 233 return test_server_->GetURL(expanded_url.MaybeAsASCII()); | 233 return test_server_->GetURL(expanded_url.MaybeAsASCII()); |
| 234 } | 234 } |
| 235 | 235 |
| 236 bool NaClBrowserTestBase::RunJavascriptTest(const GURL& url, | 236 bool NaClBrowserTestBase::RunJavascriptTest(const GURL& url, |
| 237 TestMessageHandler* handler) { | 237 TestMessageHandler* handler) { |
| 238 JavascriptTestObserver observer( | 238 JavascriptTestObserver observer( |
| 239 browser()->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost(), | 239 browser()->tab_strip_model()->GetActiveWebContents(), |
| 240 handler); | 240 handler); |
| 241 ui_test_utils::NavigateToURL(browser(), url); | 241 ui_test_utils::NavigateToURL(browser(), url); |
| 242 return observer.Run(); | 242 return observer.Run(); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void NaClBrowserTestBase::RunLoadTest( | 245 void NaClBrowserTestBase::RunLoadTest( |
| 246 const base::FilePath::StringType& test_file) { | 246 const base::FilePath::StringType& test_file) { |
| 247 LoadTestMessageHandler handler; | 247 LoadTestMessageHandler handler; |
| 248 base::FilePath::StringType test_file_with_pnacl = test_file; | 248 base::FilePath::StringType test_file_with_pnacl = test_file; |
| 249 if (IsAPnaclTest()) { | 249 if (IsAPnaclTest()) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 } | 319 } |
| 320 | 320 |
| 321 base::FilePath::StringType NaClBrowserTestStatic::Variant() { | 321 base::FilePath::StringType NaClBrowserTestStatic::Variant() { |
| 322 return FILE_PATH_LITERAL("static"); | 322 return FILE_PATH_LITERAL("static"); |
| 323 } | 323 } |
| 324 | 324 |
| 325 bool NaClBrowserTestStatic::GetDocumentRoot(base::FilePath* document_root) { | 325 bool NaClBrowserTestStatic::GetDocumentRoot(base::FilePath* document_root) { |
| 326 *document_root = base::FilePath(FILE_PATH_LITERAL("chrome/test/data/nacl")); | 326 *document_root = base::FilePath(FILE_PATH_LITERAL("chrome/test/data/nacl")); |
| 327 return true; | 327 return true; |
| 328 } | 328 } |
| OLD | NEW |