Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: content/browser/service_worker/service_worker_registration_unittest.cc

Issue 2218943002: Introduce ServiceWorker.EventDispatchingDelay UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated mpearson@'s comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_registration_unittest.cc
diff --git a/content/browser/service_worker/service_worker_registration_unittest.cc b/content/browser/service_worker/service_worker_registration_unittest.cc
index 75272826755c2ea028569669a04cb85a27297a40..494240c3febc826699ea477af0be4df1380ced88 100644
--- a/content/browser/service_worker/service_worker_registration_unittest.cc
+++ b/content/browser/service_worker/service_worker_registration_unittest.cc
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/run_loop.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/time/time.h"
#include "content/browser/service_worker/embedded_worker_status.h"
#include "content/browser/service_worker/embedded_worker_test_helper.h"
#include "content/browser/service_worker/service_worker_context_core.h"
@@ -272,7 +273,8 @@ TEST_F(ServiceWorkerActivationTest, NoInflightRequest) {
EXPECT_EQ(version_1.get(), reg->active_version());
// Finish the request. Activation should happen.
- version_1->FinishRequest(inflight_request_id(), true /* was_handled */);
+ version_1->FinishRequest(inflight_request_id(), true /* was_handled */,
+ base::Time::Now());
base::RunLoop().RunUntilIdle();
EXPECT_EQ(version_2.get(), reg->active_version());
}
@@ -285,7 +287,8 @@ TEST_F(ServiceWorkerActivationTest, NoControllee) {
// Finish the request. Since there is a controllee, activation should not yet
// happen.
- version_1->FinishRequest(inflight_request_id(), true /* was_handled */);
+ version_1->FinishRequest(inflight_request_id(), true /* was_handled */,
+ base::Time::Now());
base::RunLoop().RunUntilIdle();
EXPECT_EQ(version_1.get(), reg->active_version());
@@ -303,7 +306,8 @@ TEST_F(ServiceWorkerActivationTest, SkipWaiting) {
// Finish the in-flight request. Since there is a controllee,
// activation should not happen.
- version_1->FinishRequest(inflight_request_id(), true /* was_handled */);
+ version_1->FinishRequest(inflight_request_id(), true /* was_handled */,
+ base::Time::Now());
base::RunLoop().RunUntilIdle();
EXPECT_EQ(version_1.get(), reg->active_version());
@@ -326,7 +330,8 @@ TEST_F(ServiceWorkerActivationTest, SkipWaitingWithInflightRequest) {
EXPECT_EQ(version_1.get(), reg->active_version());
// Finish the request. Activation should happen.
- version_1->FinishRequest(inflight_request_id(), true /* was_handled */);
+ version_1->FinishRequest(inflight_request_id(), true /* was_handled */,
+ base::Time::Now());
base::RunLoop().RunUntilIdle();
EXPECT_EQ(version_2.get(), reg->active_version());
}

Powered by Google App Engine
This is Rietveld 408576698