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/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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
451 for (size_t i = 0; i < libraries.size(); ++i) | 451 for (size_t i = 0; i < libraries.size(); ++i) |
452 test_handler_->PreloadJavaScript(libraries[i], preload_host); | 452 test_handler_->PreloadJavaScript(libraries[i], preload_host); |
453 | 453 |
454 if (is_test) | 454 if (is_test) |
455 result = test_handler_->RunJavaScriptTestWithResult(content); | 455 result = test_handler_->RunJavaScriptTestWithResult(content); |
456 else if (preload_host) | 456 else if (preload_host) |
457 test_handler_->PreloadJavaScript(content, preload_host); | 457 test_handler_->PreloadJavaScript(content, preload_host); |
458 else | 458 else |
459 test_handler_->RunJavaScript(content); | 459 test_handler_->RunJavaScript(content); |
460 | 460 |
461 for (const auto& msg : error_messages_.Get()) { | |
Paweł Hajdan Jr.
2016/07/11 15:37:38
Consider extracting this change to a separate CL.
stevenjb
2016/07/11 16:37:23
+1, I like the idea behind the change, but agree t
Alexander Alekseev
2016/07/12 04:12:14
Done.
Alexander Alekseev
2016/07/12 04:12:14
I moved this change to amother CL: https://coderev
| |
462 LOG(ERROR) << "Encountered javascript console error: '" << msg << "'"; | |
463 } | |
464 | |
461 if (error_messages_.Get().size() > 0) { | 465 if (error_messages_.Get().size() > 0) { |
462 LOG(ERROR) << "Encountered javascript console error(s)"; | 466 LOG(ERROR) << "Encountered javascript console error(s)"; |
463 result = false; | 467 result = false; |
464 error_messages_.Get().clear(); | 468 error_messages_.Get().clear(); |
465 } | 469 } |
466 return result; | 470 return result; |
467 } | 471 } |
468 | 472 |
469 void WebUIBrowserTest::SetupHandlers() { | 473 void WebUIBrowserTest::SetupHandlers() { |
470 content::WebUI* web_ui_instance = | 474 content::WebUI* web_ui_instance = |
(...skipping 12 matching lines...) Expand all Loading... | |
483 } | 487 } |
484 | 488 |
485 GURL WebUIBrowserTest::WebUITestDataPathToURL( | 489 GURL WebUIBrowserTest::WebUITestDataPathToURL( |
486 const base::FilePath::StringType& path) { | 490 const base::FilePath::StringType& path) { |
487 base::FilePath dir_test_data; | 491 base::FilePath dir_test_data; |
488 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); | 492 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); |
489 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path)); | 493 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path)); |
490 EXPECT_TRUE(base::PathExists(test_path)); | 494 EXPECT_TRUE(base::PathExists(test_path)); |
491 return net::FilePathToFileURL(test_path); | 495 return net::FilePathToFileURL(test_path); |
492 } | 496 } |
OLD | NEW |