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

Unified Diff: chrome/browser/chrome_service_worker_browsertest.cc

Issue 2158253002: Use WebContents::GetManifest in ServiceWorker FetchTest instead of RequestAppBannerFromDevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/RequestAppBannerAndGetIssuedRequests/GetManifestAndIssuedRequests/ Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_service_worker_browsertest.cc
diff --git a/chrome/browser/chrome_service_worker_browsertest.cc b/chrome/browser/chrome_service_worker_browsertest.cc
index 8d054fc64659d88a29cd2d5840b2fade6b70de58..83b9486ec5e930c7171d895c4fe0be36bb1ddfd2 100644
--- a/chrome/browser/chrome_service_worker_browsertest.cc
+++ b/chrome/browser/chrome_service_worker_browsertest.cc
@@ -241,11 +241,6 @@ class ChromeServiceWorkerManifestFetchTest
ChromeServiceWorkerManifestFetchTest() {}
~ChromeServiceWorkerManifestFetchTest() override {}
- void SetUpCommandLine(base::CommandLine* command_line) override {
- ChromeServiceWorkerFetchTest::SetUpCommandLine(command_line);
- command_line->AppendSwitch(switches::kEnableAddToShelf);
- }
-
std::string ExecuteManifestFetchTest(const std::string& url,
const std::string& cross_origin) {
std::string js(
@@ -260,7 +255,7 @@ class ChromeServiceWorkerManifestFetchTest
}
js += "document.head.appendChild(link);";
ExecuteJavaScriptForTests(js);
- return RequestAppBannerAndGetIssuedRequests();
+ return GetManifestAndIssuedRequests();
}
private:
@@ -272,13 +267,22 @@ class ChromeServiceWorkerManifestFetchTest
->ExecuteJavaScriptForTests(base::ASCIIToUTF16(js));
}
- std::string RequestAppBannerAndGetIssuedRequests() {
- browser()->RequestAppBannerFromDevTools(
- browser()->tab_strip_model()->GetActiveWebContents());
+ std::string GetManifestAndIssuedRequests() {
+ base::RunLoop run_loop;
+ browser()->tab_strip_model()->GetActiveWebContents()->GetManifest(
+ base::Bind(&ManifestCallbackAndRun, run_loop.QuitClosure()));
+ run_loop.Run();
return ExecuteScriptAndExtractString(
"if (issuedRequests.length != 0) reportRequests();"
"else reportOnFetch = true;");
}
+
+ static void ManifestCallbackAndRun(const base::Closure& continuation,
+ const GURL&,
+ const content::Manifest&) {
+ continuation.Run();
+ }
+
DISALLOW_COPY_AND_ASSIGN(ChromeServiceWorkerManifestFetchTest);
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698