| 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 "content/browser/fileapi/chrome_blob_storage_context.h" | 9 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
| 10 #include "content/browser/service_worker/embedded_worker_instance.h" | 10 #include "content/browser/service_worker/embedded_worker_instance.h" |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 static int CountRenderProcessHosts() { | 605 static int CountRenderProcessHosts() { |
| 606 int result = 0; | 606 int result = 0; |
| 607 for (RenderProcessHost::iterator iter(RenderProcessHost::AllHostsIterator()); | 607 for (RenderProcessHost::iterator iter(RenderProcessHost::AllHostsIterator()); |
| 608 !iter.IsAtEnd(); | 608 !iter.IsAtEnd(); |
| 609 iter.Advance()) { | 609 iter.Advance()) { |
| 610 result++; | 610 result++; |
| 611 } | 611 } |
| 612 return result; | 612 return result; |
| 613 } | 613 } |
| 614 | 614 |
| 615 IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) { | 615 // Crashes on Android: http://crbug.com/387045 |
| 616 #if defined(OS_ANDROID) |
| 617 #define MAYBE_Registration DISABLED_Registration |
| 618 #else |
| 619 #define MAYBE_Registration Registration |
| 620 #endif |
| 621 IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, MAYBE_Registration) { |
| 616 // Close the only window to be sure we're not re-using its RenderProcessHost. | 622 // Close the only window to be sure we're not re-using its RenderProcessHost. |
| 617 shell()->Close(); | 623 shell()->Close(); |
| 618 EXPECT_EQ(0, CountRenderProcessHosts()); | 624 EXPECT_EQ(0, CountRenderProcessHosts()); |
| 619 | 625 |
| 620 const std::string kWorkerUrl = "/service_worker/fetch_event.js"; | 626 const std::string kWorkerUrl = "/service_worker/fetch_event.js"; |
| 621 | 627 |
| 622 // Unregistering nothing should return true. | 628 // Unregistering nothing should return true. |
| 623 { | 629 { |
| 624 base::RunLoop run_loop; | 630 base::RunLoop run_loop; |
| 625 public_context()->UnregisterServiceWorker( | 631 public_context()->UnregisterServiceWorker( |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, | 701 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, |
| 696 this, | 702 this, |
| 697 embedded_test_server()->GetURL("/service_worker/empty.html"), | 703 embedded_test_server()->GetURL("/service_worker/empty.html"), |
| 698 &status, | 704 &status, |
| 699 &script_url)); | 705 &script_url)); |
| 700 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); | 706 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); |
| 701 } | 707 } |
| 702 } | 708 } |
| 703 | 709 |
| 704 } // namespace content | 710 } // namespace content |
| OLD | NEW |