| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, StartNotFound) { | 951 IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, StartNotFound) { |
| 952 StartServerAndNavigateToSetup(); | 952 StartServerAndNavigateToSetup(); |
| 953 RunOnIOThread(base::Bind(&self::SetUpRegistrationOnIOThread, | 953 RunOnIOThread(base::Bind(&self::SetUpRegistrationOnIOThread, |
| 954 base::Unretained(this), | 954 base::Unretained(this), |
| 955 "/service_worker/nonexistent.js")); | 955 "/service_worker/nonexistent.js")); |
| 956 | 956 |
| 957 // Start a worker for nonexistent URL. | 957 // Start a worker for nonexistent URL. |
| 958 StartWorker(SERVICE_WORKER_ERROR_NETWORK); | 958 StartWorker(SERVICE_WORKER_ERROR_NETWORK); |
| 959 } | 959 } |
| 960 | 960 |
| 961 IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, ReadResourceFailure) { | 961 #if defined(ANDROID) |
| 962 // Flaky failures on Android; see https://crbug.com/720275. |
| 963 #define MAYBE_ReadResourceFailure DISABLED_ReadResourceFailure |
| 964 #else |
| 965 #define MAYBE_ReadResourceFailure ReadResourceFailure |
| 966 #endif |
| 967 IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, |
| 968 MAYBE_ReadResourceFailure) { |
| 962 StartServerAndNavigateToSetup(); | 969 StartServerAndNavigateToSetup(); |
| 963 // Create a registration. | 970 // Create a registration. |
| 964 RunOnIOThread(base::Bind(&self::SetUpRegistrationOnIOThread, | 971 RunOnIOThread(base::Bind(&self::SetUpRegistrationOnIOThread, |
| 965 base::Unretained(this), | 972 base::Unretained(this), |
| 966 "/service_worker/worker.js")); | 973 "/service_worker/worker.js")); |
| 967 version_->set_fetch_handler_existence( | 974 version_->set_fetch_handler_existence( |
| 968 ServiceWorkerVersion::FetchHandlerExistence::EXISTS); | 975 ServiceWorkerVersion::FetchHandlerExistence::EXISTS); |
| 969 version_->SetStatus(ServiceWorkerVersion::ACTIVATED); | 976 version_->SetStatus(ServiceWorkerVersion::ACTIVATED); |
| 970 | 977 |
| 971 // Add a non-existent resource to the version. | 978 // Add a non-existent resource to the version. |
| (...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2998 // effect in CanSuspendRenderer(). | 3005 // effect in CanSuspendRenderer(). |
| 2999 shell()->web_contents()->WasHidden(); | 3006 shell()->web_contents()->WasHidden(); |
| 3000 EXPECT_TRUE(rph->IsProcessBackgrounded()); | 3007 EXPECT_TRUE(rph->IsProcessBackgrounded()); |
| 3001 | 3008 |
| 3002 // The process which has service worker thread shouldn't be suspended. | 3009 // The process which has service worker thread shouldn't be suspended. |
| 3003 EXPECT_FALSE(memory_coordinator->CanSuspendRenderer(render_process_id)); | 3010 EXPECT_FALSE(memory_coordinator->CanSuspendRenderer(render_process_id)); |
| 3004 } | 3011 } |
| 3005 #endif | 3012 #endif |
| 3006 | 3013 |
| 3007 } // namespace content | 3014 } // namespace content |
| OLD | NEW |