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

Unified Diff: content/browser/service_worker/embedded_worker_test_helper.cc

Issue 2580793004: service worker: Add CHECKs for investigating null http info bug. (Closed)
Patch Set: Fix foreign fetch Created 4 years 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: content/browser/service_worker/embedded_worker_test_helper.cc
diff --git a/content/browser/service_worker/embedded_worker_test_helper.cc b/content/browser/service_worker/embedded_worker_test_helper.cc
index a5daba0afd1e1d06eabaf421c2547f95a93af563..90ec433aa8b7d1c501447226d1aad505f1d99cf0 100644
--- a/content/browser/service_worker/embedded_worker_test_helper.cc
+++ b/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -280,6 +280,18 @@ void EmbeddedWorkerTestHelper::ShutdownContext() {
wrapper_ = NULL;
}
+// static
+net::HttpResponseInfo EmbeddedWorkerTestHelper::CreateHttpResponseInfo() {
+ net::HttpResponseInfo info;
+ const char data[] =
+ "HTTP/1.1 200 OK\0"
+ "Content-Type: application/javascript\0"
+ "\0";
+ info.headers =
+ new net::HttpResponseHeaders(std::string(data, arraysize(data)));
+ return info;
+}
+
void EmbeddedWorkerTestHelper::OnStartWorker(int embedded_worker_id,
int64_t service_worker_version_id,
const GURL& scope,
@@ -404,6 +416,7 @@ void EmbeddedWorkerTestHelper::SimulateWorkerScriptCached(
records.push_back(ServiceWorkerDatabase::ResourceRecord(
embedded_worker_id, version->script_url(), 100));
version->script_cache_map()->SetResources(records);
+ version->SetMainScriptHttpResponseInfo(CreateHttpResponseInfo());
}
void EmbeddedWorkerTestHelper::SimulateWorkerScriptLoaded(

Powered by Google App Engine
This is Rietveld 408576698