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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_test.cc

Issue 580133002: Update entry page type to include error pages when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address suggestions. Created 6 years, 3 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 | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/tabs/tabs_test.cc
diff --git a/chrome/browser/extensions/api/tabs/tabs_test.cc b/chrome/browser/extensions/api/tabs/tabs_test.cc
index f890355e3afd15593d7f44c71dca8bb98ff7febf..cd55290a5241a847d013462c6d62a1acffe53766 100644
--- a/chrome/browser/extensions/api/tabs/tabs_test.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_test.cc
@@ -27,6 +27,7 @@
#include "content/public/common/url_constants.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/test_util.h"
+#include "net/test/spawned_test_server/spawned_test_server.h"
#include "ui/gfx/rect.h"
namespace extensions {
@@ -796,11 +797,20 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsZoomTest, SetAndGetZoom) {
}
IN_PROC_BROWSER_TEST_F(ExtensionTabsZoomTest, ZoomSettings) {
- const char kNewTestTabArgsA[] = "http://hostA/";
- const char kNewTestTabArgsB[] = "http://hostB/";
-
- GURL url_A(kNewTestTabArgsA);
- GURL url_B(kNewTestTabArgsB);
+ // In this test we need two URLs that (1) represent real pages (i.e. they
+ // load without causing an error page load), (2) have different domains, and
+ // (3) are zoomable by the extension API (this last condition rules out
+ // chrome:// urls). We achieve this by noting that about:blank meets these
+ // requirements, allowing us to spin up a spawned http server on localhost to
+ // get the other domain.
+ net::SpawnedTestServer http_server(
+ net::SpawnedTestServer::TYPE_HTTP,
+ net::SpawnedTestServer::kLocalhost,
+ base::FilePath(FILE_PATH_LITERAL("chrome/test/data")));
+ ASSERT_TRUE(http_server.Start());
+
+ GURL url_A = http_server.GetURL("files/simple.html");
+ GURL url_B("about:blank");
// Tabs A1 and A2 are navigated to the same origin, while B is navigated
// to a different one.
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698