Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / content / browser / service_worker / service_worker_handle_unittest.cc
index 70c4456..8e4edd3 100644 (file)
@@ -47,7 +47,7 @@ class ServiceWorkerHandleTest : public testing::Test {
     helper_.reset(new EmbeddedWorkerTestHelper(kRenderProcessId));
 
     registration_ = new ServiceWorkerRegistration(
-        GURL("http://www.example.com/*"),
+        GURL("http://www.example.com/"),
         GURL("http://www.example.com/service_worker.js"),
         1L,
         helper_->context()->AsWeakPtr());
@@ -71,6 +71,8 @@ class ServiceWorkerHandleTest : public testing::Test {
   scoped_ptr<EmbeddedWorkerTestHelper> helper_;
   scoped_refptr<ServiceWorkerRegistration> registration_;
   scoped_refptr<ServiceWorkerVersion> version_;
+
+ private:
   DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandleTest);
 };
 
@@ -79,6 +81,7 @@ TEST_F(ServiceWorkerHandleTest, OnVersionStateChanged) {
       ServiceWorkerHandle::Create(helper_->context()->AsWeakPtr(),
                                   helper_.get(),
                                   1 /* thread_id */,
+                                  33 /* provider_id */,
                                   version_);
 
   // Start the worker, and then...
@@ -89,10 +92,13 @@ TEST_F(ServiceWorkerHandleTest, OnVersionStateChanged) {
 
   // ...dispatch install event.
   status = SERVICE_WORKER_ERROR_FAILED;
+  version_->SetStatus(ServiceWorkerVersion::INSTALLING);
   version_->DispatchInstallEvent(-1, CreateReceiverOnCurrentThread(&status));
   base::RunLoop().RunUntilIdle();
   EXPECT_EQ(SERVICE_WORKER_OK, status);
 
+  version_->SetStatus(ServiceWorkerVersion::INSTALLED);
+
   ASSERT_EQ(4UL, ipc_sink()->message_count());
 
   // We should be sending 1. StartWorker,