| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 10 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 }; | 304 }; |
| 305 | 305 |
| 306 class EmbeddedWorkerBrowserTest : public ServiceWorkerBrowserTest, | 306 class EmbeddedWorkerBrowserTest : public ServiceWorkerBrowserTest, |
| 307 public EmbeddedWorkerInstance::Listener { | 307 public EmbeddedWorkerInstance::Listener { |
| 308 public: | 308 public: |
| 309 typedef EmbeddedWorkerBrowserTest self; | 309 typedef EmbeddedWorkerBrowserTest self; |
| 310 | 310 |
| 311 EmbeddedWorkerBrowserTest() | 311 EmbeddedWorkerBrowserTest() |
| 312 : last_worker_status_(EmbeddedWorkerInstance::STOPPED), | 312 : last_worker_status_(EmbeddedWorkerInstance::STOPPED), |
| 313 pause_mode_(DONT_PAUSE) {} | 313 pause_mode_(DONT_PAUSE) {} |
| 314 virtual ~EmbeddedWorkerBrowserTest() {} | 314 ~EmbeddedWorkerBrowserTest() override {} |
| 315 | 315 |
| 316 void TearDownOnIOThread() override { | 316 void TearDownOnIOThread() override { |
| 317 if (worker_) { | 317 if (worker_) { |
| 318 worker_->RemoveListener(this); | 318 worker_->RemoveListener(this); |
| 319 worker_.reset(); | 319 worker_.reset(); |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 | 322 |
| 323 void StartOnIOThread() { | 323 void StartOnIOThread() { |
| 324 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 324 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 | 409 |
| 410 // Called by EmbeddedWorkerInstance::Observer overrides so that | 410 // Called by EmbeddedWorkerInstance::Observer overrides so that |
| 411 // test code can wait for the worker status notifications. | 411 // test code can wait for the worker status notifications. |
| 412 base::Closure done_closure_; | 412 base::Closure done_closure_; |
| 413 }; | 413 }; |
| 414 | 414 |
| 415 class ServiceWorkerVersionBrowserTest : public ServiceWorkerBrowserTest { | 415 class ServiceWorkerVersionBrowserTest : public ServiceWorkerBrowserTest { |
| 416 public: | 416 public: |
| 417 typedef ServiceWorkerVersionBrowserTest self; | 417 typedef ServiceWorkerVersionBrowserTest self; |
| 418 | 418 |
| 419 virtual ~ServiceWorkerVersionBrowserTest() {} | 419 ~ServiceWorkerVersionBrowserTest() override {} |
| 420 | 420 |
| 421 void TearDownOnIOThread() override { | 421 void TearDownOnIOThread() override { |
| 422 registration_ = NULL; | 422 registration_ = NULL; |
| 423 version_ = NULL; | 423 version_ = NULL; |
| 424 } | 424 } |
| 425 | 425 |
| 426 void InstallTestHelper(const std::string& worker_url, | 426 void InstallTestHelper(const std::string& worker_url, |
| 427 ServiceWorkerStatusCode expected_status) { | 427 ServiceWorkerStatusCode expected_status) { |
| 428 RunOnIOThread(base::Bind(&self::SetUpRegistrationOnIOThread, this, | 428 RunOnIOThread(base::Bind(&self::SetUpRegistrationOnIOThread, this, |
| 429 worker_url)); | 429 worker_url)); |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 RunOnIOThread( | 938 RunOnIOThread( |
| 939 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, | 939 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, |
| 940 this, | 940 this, |
| 941 embedded_test_server()->GetURL("/service_worker/empty.html"), | 941 embedded_test_server()->GetURL("/service_worker/empty.html"), |
| 942 &status)); | 942 &status)); |
| 943 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); | 943 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); |
| 944 } | 944 } |
| 945 } | 945 } |
| 946 | 946 |
| 947 } // namespace content | 947 } // namespace content |
| OLD | NEW |