OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "chrome/browser/ui/browser.h" | |
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" | |
7 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
8 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
9 #include "chrome/test/base/ui_test_utils.h" | 11 #include "chrome/test/base/ui_test_utils.h" |
10 #include "chrome/test/base/web_ui_browser_test.h" | 12 #include "chrome/test/base/web_ui_browser_test.h" |
11 #include "net/test/embedded_test_server/embedded_test_server.h" | 13 #include "net/test/embedded_test_server/embedded_test_server.h" |
12 | 14 |
13 class WebUIWebViewBrowserTest : public WebUIBrowserTest { | 15 class WebUIWebViewBrowserTest : public WebUIBrowserTest { |
14 public: | 16 public: |
15 WebUIWebViewBrowserTest() {} | 17 WebUIWebViewBrowserTest() {} |
16 | 18 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 new base::StringValue(GetTestUrl("empty.html").spec()))); | 126 new base::StringValue(GetTestUrl("empty.html").spec()))); |
125 } | 127 } |
126 | 128 |
127 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, AddContentScriptWithCode) { | 129 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, AddContentScriptWithCode) { |
128 ui_test_utils::NavigateToURL(browser(), GetWebViewEnabledWebUIURL()); | 130 ui_test_utils::NavigateToURL(browser(), GetWebViewEnabledWebUIURL()); |
129 | 131 |
130 ASSERT_TRUE(WebUIBrowserTest::RunJavascriptAsyncTest( | 132 ASSERT_TRUE(WebUIBrowserTest::RunJavascriptAsyncTest( |
131 "testAddContentScriptWithCode", | 133 "testAddContentScriptWithCode", |
132 new base::StringValue(GetTestUrl("empty.html").spec()))); | 134 new base::StringValue(GetTestUrl("empty.html").spec()))); |
133 } | 135 } |
136 | |
137 #if defined(OS_CHROMEOS) | |
138 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, AddContentScriptIncognito) { | |
Devlin
2015/04/27 17:55:56
Awesome.
Can you:
- Put a comment saying that, ri
Xi Han
2015/04/27 18:17:48
Added. Yes, I modified other tests, which are in i
| |
139 Browser* incognito_browser = ui_test_utils::OpenURLOffTheRecord( | |
140 browser()->profile(), GetWebViewEnabledWebUIURL()); | |
141 | |
142 SetWebUIInstance( | |
143 incognito_browser->tab_strip_model()->GetActiveWebContents()->GetWebUI()); | |
144 | |
145 ASSERT_TRUE(WebUIBrowserTest::RunJavascriptAsyncTest( | |
146 "testAddContentScript", | |
147 new base::StringValue(GetTestUrl("empty.html").spec()))); | |
148 } | |
149 #endif | |
OLD | NEW |