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" |
11 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 #include "content/public/test/browser_test_utils.h" | 13 #include "content/public/test/browser_test_utils.h" |
14 #include "grit/webui_resources.h" | 14 #include "ui/resources/grit/webui_resources.h" |
15 | 15 |
16 class WebUIResourceBrowserTest : public InProcessBrowserTest { | 16 class WebUIResourceBrowserTest : public InProcessBrowserTest { |
17 public: | 17 public: |
18 // Runs all test functions in |file|, waiting for them to complete. | 18 // Runs all test functions in |file|, waiting for them to complete. |
19 void RunTest(const base::FilePath& file) { | 19 void RunTest(const base::FilePath& file) { |
20 GURL url = ui_test_utils::GetTestUrl( | 20 GURL url = ui_test_utils::GetTestUrl( |
21 base::FilePath(FILE_PATH_LITERAL("webui")), file); | 21 base::FilePath(FILE_PATH_LITERAL("webui")), file); |
22 ui_test_utils::NavigateToURL(browser(), url); | 22 ui_test_utils::NavigateToURL(browser(), url); |
23 | 23 |
24 content::WebContents* web_contents = | 24 content::WebContents* web_contents = |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 AddLibrary(IDR_WEBUI_JS_CR_UI_POSITION_UTIL); | 135 AddLibrary(IDR_WEBUI_JS_CR_UI_POSITION_UTIL); |
136 RunTest(base::FilePath(FILE_PATH_LITERAL("position_util_test.html"))); | 136 RunTest(base::FilePath(FILE_PATH_LITERAL("position_util_test.html"))); |
137 } | 137 } |
138 | 138 |
139 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, RepeatingButtonTest) { | 139 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, RepeatingButtonTest) { |
140 AddLibrary(IDR_WEBUI_JS_CR); | 140 AddLibrary(IDR_WEBUI_JS_CR); |
141 AddLibrary(IDR_WEBUI_JS_CR_UI); | 141 AddLibrary(IDR_WEBUI_JS_CR_UI); |
142 AddLibrary(IDR_WEBUI_JS_CR_UI_REPEATING_BUTTON); | 142 AddLibrary(IDR_WEBUI_JS_CR_UI_REPEATING_BUTTON); |
143 RunTest(base::FilePath(FILE_PATH_LITERAL("repeating_button_test.html"))); | 143 RunTest(base::FilePath(FILE_PATH_LITERAL("repeating_button_test.html"))); |
144 } | 144 } |
OLD | NEW |