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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 static int CountRenderProcessHosts() { | 854 static int CountRenderProcessHosts() { |
855 int result = 0; | 855 int result = 0; |
856 for (RenderProcessHost::iterator iter(RenderProcessHost::AllHostsIterator()); | 856 for (RenderProcessHost::iterator iter(RenderProcessHost::AllHostsIterator()); |
857 !iter.IsAtEnd(); | 857 !iter.IsAtEnd(); |
858 iter.Advance()) { | 858 iter.Advance()) { |
859 result++; | 859 result++; |
860 } | 860 } |
861 return result; | 861 return result; |
862 } | 862 } |
863 | 863 |
864 IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) { | 864 // Flaky timeouts on CrOS: http://crbug.com/387045 |
| 865 #if defined(OS_CHROMEOS) |
| 866 #define MAYBE_Registration DISABLED_Registration |
| 867 #else |
| 868 #define MAYBE_Registration Registration |
| 869 #endif |
| 870 IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, MAYBE_Registration) { |
865 // Close the only window to be sure we're not re-using its RenderProcessHost. | 871 // Close the only window to be sure we're not re-using its RenderProcessHost. |
866 shell()->Close(); | 872 shell()->Close(); |
867 EXPECT_EQ(0, CountRenderProcessHosts()); | 873 EXPECT_EQ(0, CountRenderProcessHosts()); |
868 | 874 |
869 const std::string kWorkerUrl = "/service_worker/fetch_event.js"; | 875 const std::string kWorkerUrl = "/service_worker/fetch_event.js"; |
870 | 876 |
871 // Unregistering nothing should return false. | 877 // Unregistering nothing should return false. |
872 { | 878 { |
873 base::RunLoop run_loop; | 879 base::RunLoop run_loop; |
874 public_context()->UnregisterServiceWorker( | 880 public_context()->UnregisterServiceWorker( |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 RunOnIOThread( | 938 RunOnIOThread( |
933 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, | 939 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, |
934 this, | 940 this, |
935 embedded_test_server()->GetURL("/service_worker/empty.html"), | 941 embedded_test_server()->GetURL("/service_worker/empty.html"), |
936 &status)); | 942 &status)); |
937 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); | 943 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); |
938 } | 944 } |
939 } | 945 } |
940 | 946 |
941 } // namespace content | 947 } // namespace content |
OLD | NEW |