Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: chrome/test/data/webui/webui_resource_browsertest.cc

Issue 17315020: Port passing closure tests for cr.ui framework to browser tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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")));
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 }
OLDNEW
« no previous file with comments | « chrome/test/data/webui/position_util_test.html ('k') | chrome/test/data/webui/webui_resource_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698