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

Unified Diff: chrome/browser/ui/webui/webui_webview_browsertest.cc

Issue 1062963006: Make WebUI webview content script work with incognito. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webui_api_4
Patch Set: Comments Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | extensions/browser/web_ui_user_script_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/webui_webview_browsertest.cc
diff --git a/chrome/browser/ui/webui/webui_webview_browsertest.cc b/chrome/browser/ui/webui/webui_webview_browsertest.cc
index 6c3ed9c8cfcaba3787a706d88cad7b4f43af6b81..a8fcadc504327d8b870f703f6082fdfc957730fd 100644
--- a/chrome/browser/ui/webui/webui_webview_browsertest.cc
+++ b/chrome/browser/ui/webui/webui_webview_browsertest.cc
@@ -4,6 +4,8 @@
#include "base/macros.h"
#include "base/path_service.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -131,3 +133,19 @@ IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, AddContentScriptWithCode) {
"testAddContentScriptWithCode",
new base::StringValue(GetTestUrl("empty.html").spec())));
}
+
+#if defined(OS_CHROMEOS)
+// Right now we only have incognito WebUI on CrOS, but this should
+// theoretically work for all platforms.
+IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, AddContentScriptIncognito) {
+ Browser* incognito_browser = ui_test_utils::OpenURLOffTheRecord(
+ browser()->profile(), GetWebViewEnabledWebUIURL());
+
+ SetWebUIInstance(
+ incognito_browser->tab_strip_model()->GetActiveWebContents()->GetWebUI());
+
+ ASSERT_TRUE(WebUIBrowserTest::RunJavascriptAsyncTest(
+ "testAddContentScript",
+ new base::StringValue(GetTestUrl("empty.html").spec())));
+}
+#endif
« no previous file with comments | « no previous file | extensions/browser/web_ui_user_script_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698