Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / browser / service_worker / service_worker_handle_unittest.cc
index 8e4edd3..3368dc1 100644 (file)
@@ -46,17 +46,18 @@ class ServiceWorkerHandleTest : public testing::Test {
   virtual void SetUp() OVERRIDE {
     helper_.reset(new EmbeddedWorkerTestHelper(kRenderProcessId));
 
+    const GURL pattern("http://www.example.com/");
     registration_ = new ServiceWorkerRegistration(
-        GURL("http://www.example.com/"),
-        GURL("http://www.example.com/service_worker.js"),
+        pattern,
         1L,
         helper_->context()->AsWeakPtr());
     version_ = new ServiceWorkerVersion(
-        registration_, 1L, helper_->context()->AsWeakPtr());
+        registration_.get(),
+        GURL("http://www.example.com/service_worker.js"),
+        1L,
+        helper_->context()->AsWeakPtr());
 
-    // Simulate adding one process to the worker.
-    int embedded_worker_id = version_->embedded_worker()->embedded_worker_id();
-    helper_->SimulateAddProcessToWorker(embedded_worker_id, kRenderProcessId);
+    helper_->SimulateAddProcessToPattern(pattern, kRenderProcessId);
   }
 
   virtual void TearDown() OVERRIDE {
@@ -82,7 +83,7 @@ TEST_F(ServiceWorkerHandleTest, OnVersionStateChanged) {
                                   helper_.get(),
                                   1 /* thread_id */,
                                   33 /* provider_id */,
-                                  version_);
+                                  version_.get());
 
   // Start the worker, and then...
   ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED;