OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
10 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 *include_libraries_iterator); | 37 *include_libraries_iterator); |
38 library_content.AppendToString(&script); | 38 library_content.AppendToString(&script); |
39 script.append("\n"); | 39 script.append("\n"); |
40 } | 40 } |
41 ExecuteJavascriptOnCurrentTab(script); | 41 ExecuteJavascriptOnCurrentTab(script); |
42 | 42 |
43 content::DOMMessageQueue message_queue; | 43 content::DOMMessageQueue message_queue; |
44 std::string message; | 44 std::string message; |
45 ExecuteJavascriptOnCurrentTab("runTests()"); | 45 ExecuteJavascriptOnCurrentTab("runTests()"); |
46 ASSERT_TRUE(message_queue.WaitForMessage(&message)); | 46 ASSERT_TRUE(message_queue.WaitForMessage(&message)); |
| 47 while (message.compare("\"PENDING\"") == 0) { |
| 48 ASSERT_TRUE(message_queue.WaitForMessage(&message)); |
| 49 } |
47 EXPECT_STREQ("\"SUCCESS\"", message.c_str()); | 50 EXPECT_STREQ("\"SUCCESS\"", message.c_str()); |
48 } | 51 } |
49 | 52 |
50 // Queues the library corresponding to |resource_id| for injection into the | 53 // Queues the library corresponding to |resource_id| for injection into the |
51 // test. The code injection is performed post-load, so any common test | 54 // test. The code injection is performed post-load, so any common test |
52 // initialization that depends on the library should be placed in a setUp | 55 // initialization that depends on the library should be placed in a setUp |
53 // function. | 56 // function. |
54 void AddLibrary(int resource_id) { | 57 void AddLibrary(int resource_id) { |
55 include_libraries.push_back(resource_id); | 58 include_libraries.push_back(resource_id); |
56 } | 59 } |
(...skipping 13 matching lines...) Expand all Loading... |
70 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, PropertyTest) { | 73 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, PropertyTest) { |
71 AddLibrary(IDR_WEBUI_JS_CR); | 74 AddLibrary(IDR_WEBUI_JS_CR); |
72 AddLibrary(IDR_WEBUI_JS_CR_EVENT_TARGET); | 75 AddLibrary(IDR_WEBUI_JS_CR_EVENT_TARGET); |
73 RunTest(base::FilePath(FILE_PATH_LITERAL("cr_test.html"))); | 76 RunTest(base::FilePath(FILE_PATH_LITERAL("cr_test.html"))); |
74 } | 77 } |
75 | 78 |
76 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, LocalStringsTest) { | 79 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, LocalStringsTest) { |
77 AddLibrary(IDR_WEBUI_JS_LOCAL_STRINGS); | 80 AddLibrary(IDR_WEBUI_JS_LOCAL_STRINGS); |
78 RunTest(base::FilePath(FILE_PATH_LITERAL("local_strings_test.html"))); | 81 RunTest(base::FilePath(FILE_PATH_LITERAL("local_strings_test.html"))); |
79 } | 82 } |
| 83 |
| 84 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, ParseHtmlSubsetTest) { |
| 85 AddLibrary(IDR_WEBUI_JS_PARSE_HTML_SUBSET); |
| 86 RunTest(base::FilePath(FILE_PATH_LITERAL("parse_html_subset_test.html"))); |
| 87 } |
OLD | NEW |