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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 content::RenderViewHost* rvh = browser()->tab_strip_model()-> | 60 content::RenderViewHost* rvh = browser()->tab_strip_model()-> |
61 GetActiveWebContents()->GetRenderViewHost(); | 61 GetActiveWebContents()->GetRenderViewHost(); |
62 ASSERT_TRUE(rvh); | 62 ASSERT_TRUE(rvh); |
63 ASSERT_TRUE(content::ExecuteScript(rvh, script)); | 63 ASSERT_TRUE(content::ExecuteScript(rvh, script)); |
64 } | 64 } |
65 | 65 |
66 // Resource IDs for internal javascript libraries to inject into the test. | 66 // Resource IDs for internal javascript libraries to inject into the test. |
67 std::vector<int> include_libraries; | 67 std::vector<int> include_libraries; |
68 }; | 68 }; |
69 | 69 |
70 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, ArrayDataModelTest) { | |
71 AddLibrary(IDR_WEBUI_JS_CR); | |
72 AddLibrary(IDR_WEBUI_JS_CR_EVENT_TARGET); | |
73 AddLibrary(IDR_WEBUI_JS_CR_UI_ARRAY_DATA_MODEL); | |
74 RunTest(base::FilePath(FILE_PATH_LITERAL("array_data_model_test.html"))); | |
75 } | |
76 | |
70 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, PropertyTest) { | 77 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, PropertyTest) { |
71 AddLibrary(IDR_WEBUI_JS_CR); | 78 AddLibrary(IDR_WEBUI_JS_CR); |
72 AddLibrary(IDR_WEBUI_JS_CR_EVENT_TARGET); | 79 AddLibrary(IDR_WEBUI_JS_CR_EVENT_TARGET); |
73 RunTest(base::FilePath(FILE_PATH_LITERAL("cr_test.html"))); | 80 RunTest(base::FilePath(FILE_PATH_LITERAL("cr_test.html"))); |
74 } | 81 } |
75 | 82 |
83 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, EventTargetTest) { | |
84 AddLibrary(IDR_WEBUI_JS_CR); | |
85 AddLibrary(IDR_WEBUI_JS_CR_EVENT_TARGET); | |
86 RunTest(base::FilePath(FILE_PATH_LITERAL("event_target_test.html"))); | |
87 } | |
88 | |
89 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, GridTest) { | |
90 AddLibrary(IDR_WEBUI_JS_CR); | |
91 AddLibrary(IDR_WEBUI_JS_CR_EVENT_TARGET); | |
92 AddLibrary(IDR_WEBUI_JS_CR_UI); | |
93 AddLibrary(IDR_WEBUI_JS_CR_UI_ARRAY_DATA_MODEL); | |
94 AddLibrary(IDR_WEBUI_JS_CR_UI_LIST); | |
95 AddLibrary(IDR_WEBUI_JS_CR_UI_LIST_ITEM); | |
96 AddLibrary(IDR_WEBUI_JS_CR_UI_LIST_SELECTION_CONTROLLER); | |
97 AddLibrary(IDR_WEBUI_JS_CR_UI_LIST_SELECTION_MODEL); | |
98 // Grid must be the last addition as it depends on list libraries. | |
99 AddLibrary(IDR_WEBUI_JS_CR_UI_GRID); | |
100 RunTest(base::FilePath(FILE_PATH_LITERAL("grid_test.html"))); | |
Dan Beam
2013/06/20 17:57:46
this is kind of tedious but i don't have a better
| |
101 } | |
102 | |
76 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, LocalStringsTest) { | 103 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, LocalStringsTest) { |
77 AddLibrary(IDR_WEBUI_JS_LOCAL_STRINGS); | 104 AddLibrary(IDR_WEBUI_JS_LOCAL_STRINGS); |
78 RunTest(base::FilePath(FILE_PATH_LITERAL("local_strings_test.html"))); | 105 RunTest(base::FilePath(FILE_PATH_LITERAL("local_strings_test.html"))); |
79 } | 106 } |
107 | |
108 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, PositionUtilTest) { | |
109 AddLibrary(IDR_WEBUI_JS_CR); | |
110 AddLibrary(IDR_WEBUI_JS_CR_UI_POSITION_UTIL); | |
111 RunTest(base::FilePath(FILE_PATH_LITERAL("position_util_test.html"))); | |
112 } | |
OLD | NEW |