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

Unified Diff: chrome/browser/extensions/content_script_apitest.cc

Issue 16268017: GTTF: convert some tests in chrome to use EmbeddedTestServer patch nr 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/content_script_apitest.cc
diff --git a/chrome/browser/extensions/content_script_apitest.cc b/chrome/browser/extensions/content_script_apitest.cc
index 1bd0dcefa1a9b58ab594f2903900354e704d516d..48f6cc6fddc2fcf2d652dd16fdc5ebcc860821d2 100644
--- a/chrome/browser/extensions/content_script_apitest.cc
+++ b/chrome/browser/extensions/content_script_apitest.cc
@@ -16,31 +16,32 @@
#include "content/public/test/browser_test_utils.h"
#include "googleurl/src/gurl.h"
#include "net/dns/mock_host_resolver.h"
+#include "net/test/embedded_test_server/embedded_test_server.h"
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptAllFrames) {
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
ASSERT_TRUE(RunExtensionTest("content_scripts/all_frames")) << message_;
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptAboutBlankIframes) {
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
ASSERT_TRUE(
RunExtensionTest("content_scripts/about_blank_iframes")) << message_;
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptExtensionIframe) {
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
ASSERT_TRUE(RunExtensionTest("content_scripts/extension_iframe")) << message_;
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptExtensionProcess) {
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
ASSERT_TRUE(
RunExtensionTest("content_scripts/extension_process")) << message_;
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptFragmentNavigation) {
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
const char* extension_name = "content_scripts/fragment";
ASSERT_TRUE(RunExtensionTest(extension_name)) << message_;
}
@@ -54,7 +55,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptFragmentNavigation) {
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_ContentScriptIsolatedWorlds) {
// This extension runs various bits of script and tests that they all run in
// the same isolated world.
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
ASSERT_TRUE(RunExtensionTest("content_scripts/isolated_world1")) << message_;
// Now load a different extension, inject into same page, verify worlds aren't
@@ -65,14 +66,14 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_ContentScriptIsolatedWorlds) {
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptIgnoreHostPermissions) {
host_resolver()->AddRule("a.com", "127.0.0.1");
host_resolver()->AddRule("b.com", "127.0.0.1");
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
ASSERT_TRUE(RunExtensionTest(
"content_scripts/dont_match_host_permissions")) << message_;
}
// crbug.com/39249 -- content scripts js should not run on view source.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptViewSource) {
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
ASSERT_TRUE(RunExtensionTest("content_scripts/view_source")) << message_;
}
@@ -80,7 +81,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptViewSource) {
// extensions.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptOtherExtensions) {
host_resolver()->AddRule("a.com", "127.0.0.1");
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
// First, load extension that sets up content script.
ASSERT_TRUE(RunExtensionTest("content_scripts/other_extensions/injector"))
<< message_;
@@ -93,7 +94,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptOtherExtensions) {
IN_PROC_BROWSER_TEST_F(
ExtensionApiTest,
DISABLED_ContentScriptStylesInjectedIntoExistingRenderers) {
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
content::WindowedNotificationObserver signal(
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
@@ -121,25 +122,29 @@ IN_PROC_BROWSER_TEST_F(
IN_PROC_BROWSER_TEST_F(ExtensionApiTest,
ContentScriptCSSLocalization) {
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
ASSERT_TRUE(RunExtensionTest("content_scripts/css_l10n")) << message_;
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptExtensionAPIs) {
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
const extensions::Extension* extension = LoadExtension(
test_data_dir_.AppendASCII("content_scripts/extension_api"));
ResultCatcher catcher;
ui_test_utils::NavigateToURL(
- browser(), test_server()->GetURL("functions.html"));
+ browser(),
+ embedded_test_server()->GetURL(
+ "/extensions/api_test/content_scripts/extension_api/functions.html"));
EXPECT_TRUE(catcher.GetNextResult());
// Navigate to a page that will cause a content script to run that starts
// listening for an extension event.
ui_test_utils::NavigateToURL(
- browser(), test_server()->GetURL("events.html"));
+ browser(),
+ embedded_test_server()->GetURL(
+ "/extensions/api_test/content_scripts/extension_api/events.html"));
// Navigate to an extension page that will fire the event events.js is
// listening for.
@@ -159,11 +164,11 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_ContentScriptPermissionsApi) {
extensions::PermissionsRequestFunction::SetIgnoreUserGestureForTests(true);
extensions::PermissionsRequestFunction::SetAutoConfirmForTests(true);
host_resolver()->AddRule("*.com", "127.0.0.1");
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_;
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptBypassPageCSP) {
- ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(StartEmbeddedTestServer());
ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_;
}
« no previous file with comments | « chrome/browser/extensions/app_process_apitest.cc ('k') | chrome/browser/extensions/content_security_policy_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698