| 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 #include "chrome/browser/ui/webui/web_ui_browsertest.h" | 4 #include "chrome/browser/ui/webui/web_ui_browsertest.h" |
| 5 | 5 |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/test/base/ui_test_utils.h" | 26 #include "chrome/test/base/ui_test_utils.h" |
| 27 #include "content/public/browser/navigation_controller.h" | 27 #include "content/public/browser/navigation_controller.h" |
| 28 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
| 29 #include "content/public/browser/web_ui_controller.h" | 29 #include "content/public/browser/web_ui_controller.h" |
| 30 #include "content/public/browser/web_ui_message_handler.h" | 30 #include "content/public/browser/web_ui_message_handler.h" |
| 31 #include "testing/gmock/include/gmock/gmock.h" | 31 #include "testing/gmock/include/gmock/gmock.h" |
| 32 #include "testing/gtest/include/gtest/gtest-spi.h" | 32 #include "testing/gtest/include/gtest/gtest-spi.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 | 34 |
| 35 using content::NavigationController; | 35 using content::NavigationController; |
| 36 using content::RenderViewHost; |
| 36 using content::WebContents; | 37 using content::WebContents; |
| 37 using content::WebUIController; | 38 using content::WebUIController; |
| 38 using content::WebUIMessageHandler; | 39 using content::WebUIMessageHandler; |
| 39 | 40 |
| 40 namespace { | 41 namespace { |
| 41 | 42 |
| 42 const FilePath::CharType kMockJS[] = FILE_PATH_LITERAL("mock4js.js"); | 43 const FilePath::CharType kMockJS[] = FILE_PATH_LITERAL("mock4js.js"); |
| 43 const FilePath::CharType kWebUILibraryJS[] = FILE_PATH_LITERAL("test_api.js"); | 44 const FilePath::CharType kWebUILibraryJS[] = FILE_PATH_LITERAL("test_api.js"); |
| 44 const FilePath::CharType kWebUITestFolder[] = FILE_PATH_LITERAL("webui"); | 45 const FilePath::CharType kWebUITestFolder[] = FILE_PATH_LITERAL("webui"); |
| 45 base::LazyInstance<std::vector<std::string> > error_messages_ = | 46 base::LazyInstance<std::vector<std::string> > error_messages_ = |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 // testDone directly and expect pass result. | 685 // testDone directly and expect pass result. |
| 685 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { | 686 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { |
| 686 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); | 687 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); |
| 687 } | 688 } |
| 688 | 689 |
| 689 // Test that calling testDone during RunJavascriptTest still completes when | 690 // Test that calling testDone during RunJavascriptTest still completes when |
| 690 // waiting for async result. | 691 // waiting for async result. |
| 691 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { | 692 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { |
| 692 ASSERT_TRUE(RunJavascriptTest("testDone")); | 693 ASSERT_TRUE(RunJavascriptTest("testDone")); |
| 693 } | 694 } |
| OLD | NEW |