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

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

Issue 2431313003: Mojofy unittests related to service workers (Closed)
Patch Set: Rebase Created 4 years, 2 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: content/browser/service_worker/service_worker_read_from_cache_job_unittest.cc
diff --git a/content/browser/service_worker/service_worker_read_from_cache_job_unittest.cc b/content/browser/service_worker/service_worker_read_from_cache_job_unittest.cc
index b903a386a0db2f3b9cc061f2a4e37dc1d8ad7a71..852c7a27e32c77e407c93b9d07a977eecdd8bfde 100644
--- a/content/browser/service_worker/service_worker_read_from_cache_job_unittest.cc
+++ b/content/browser/service_worker/service_worker_read_from_cache_job_unittest.cc
@@ -15,6 +15,7 @@
#include "content/browser/service_worker/embedded_worker_test_helper.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_registration.h"
+#include "content/browser/service_worker/service_worker_test_utils.h"
#include "content/browser/service_worker/service_worker_version.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "net/base/io_buffer.h"
@@ -188,7 +189,10 @@ class ServiceWorkerReadFromCacheJobTest : public testing::Test {
MockURLRequestDelegate delegate_;
};
-TEST_F(ServiceWorkerReadFromCacheJobTest, ReadMainScript) {
+class ServiceWorkerReadFromCacheJobTestP
+ : public MojoServiceWorkerTestP<ServiceWorkerReadFromCacheJobTest> {};
+
+TEST_P(ServiceWorkerReadFromCacheJobTestP, ReadMainScript) {
// Read the main script from the diskcache.
std::unique_ptr<net::URLRequest> request =
url_request_context_->CreateRequest(main_script_.url,
@@ -206,7 +210,7 @@ TEST_F(ServiceWorkerReadFromCacheJobTest, ReadMainScript) {
DeduceStartWorkerFailureReason(SERVICE_WORKER_OK));
}
-TEST_F(ServiceWorkerReadFromCacheJobTest, ReadImportedScript) {
+TEST_P(ServiceWorkerReadFromCacheJobTestP, ReadImportedScript) {
// Read the imported script from the diskcache.
std::unique_ptr<net::URLRequest> request =
url_request_context_->CreateRequest(imported_script_.url,
@@ -223,7 +227,7 @@ TEST_F(ServiceWorkerReadFromCacheJobTest, ReadImportedScript) {
DeduceStartWorkerFailureReason(SERVICE_WORKER_OK));
}
-TEST_F(ServiceWorkerReadFromCacheJobTest, ResourceNotFound) {
+TEST_P(ServiceWorkerReadFromCacheJobTestP, ResourceNotFound) {
ASSERT_EQ(SERVICE_WORKER_OK, FindRegistration());
// Try to read a nonexistent resource from the diskcache.
@@ -249,4 +253,8 @@ TEST_F(ServiceWorkerReadFromCacheJobTest, ResourceNotFound) {
EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, FindRegistration());
}
+INSTANTIATE_TEST_CASE_P(ServiceWorkerReadFromCacheJobTest,
+ ServiceWorkerReadFromCacheJobTestP,
+ testing::Bool());
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698