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

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

Issue 691413002: Removing redundant 'is_null' field in ServiceWorkerVersionInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 2adb68d32b97c43f502af41d2de7703f7450c353..cea4b47734b351ef943a71fb053eb5fe7c1a992e 100644
--- a/content/browser/service_worker/service_worker_registration_unittest.cc
+++ b/content/browser/service_worker/service_worker_registration_unittest.cc
@@ -120,9 +120,12 @@ TEST_F(ServiceWorkerRegistrationTest, SetAndUnsetVersions) {
EXPECT_EQ(kScope, listener.observed_info_.pattern);
EXPECT_EQ(version_1_id, listener.observed_info_.active_version.version_id);
EXPECT_EQ(kScript, listener.observed_info_.active_version.script_url);
- EXPECT_TRUE(listener.observed_info_.installing_version.is_null);
- EXPECT_TRUE(listener.observed_info_.waiting_version.is_null);
- EXPECT_TRUE(listener.observed_info_.controlling_version.is_null);
+ EXPECT_EQ(listener.observed_info_.installing_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_EQ(listener.observed_info_.waiting_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_EQ(listener.observed_info_.controlling_version.version_id,
+ kInvalidServiceWorkerVersionId);
listener.Reset();
registration->SetInstallingVersion(version_2.get());
@@ -133,8 +136,10 @@ TEST_F(ServiceWorkerRegistrationTest, SetAndUnsetVersions) {
EXPECT_EQ(version_1_id, listener.observed_info_.active_version.version_id);
EXPECT_EQ(version_2_id,
listener.observed_info_.installing_version.version_id);
- EXPECT_TRUE(listener.observed_info_.waiting_version.is_null);
- EXPECT_TRUE(listener.observed_info_.controlling_version.is_null);
+ EXPECT_EQ(listener.observed_info_.waiting_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_EQ(listener.observed_info_.controlling_version.version_id,
+ kInvalidServiceWorkerVersionId);
listener.Reset();
registration->SetWaitingVersion(version_2.get());
@@ -145,8 +150,10 @@ TEST_F(ServiceWorkerRegistrationTest, SetAndUnsetVersions) {
EXPECT_TRUE(listener.observed_changed_mask_.installing_changed());
EXPECT_EQ(version_1_id, listener.observed_info_.active_version.version_id);
EXPECT_EQ(version_2_id, listener.observed_info_.waiting_version.version_id);
- EXPECT_TRUE(listener.observed_info_.installing_version.is_null);
- EXPECT_TRUE(listener.observed_info_.controlling_version.is_null);
+ EXPECT_EQ(listener.observed_info_.installing_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_EQ(listener.observed_info_.controlling_version.version_id,
+ kInvalidServiceWorkerVersionId);
listener.Reset();
registration->UnsetVersion(version_2.get());
@@ -155,9 +162,12 @@ TEST_F(ServiceWorkerRegistrationTest, SetAndUnsetVersions) {
EXPECT_EQ(ChangedVersionAttributesMask::WAITING_VERSION,
listener.observed_changed_mask_.changed());
EXPECT_EQ(version_1_id, listener.observed_info_.active_version.version_id);
- EXPECT_TRUE(listener.observed_info_.waiting_version.is_null);
- EXPECT_TRUE(listener.observed_info_.installing_version.is_null);
- EXPECT_TRUE(listener.observed_info_.controlling_version.is_null);
+ EXPECT_EQ(listener.observed_info_.waiting_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_EQ(listener.observed_info_.installing_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_EQ(listener.observed_info_.controlling_version.version_id,
+ kInvalidServiceWorkerVersionId);
}
TEST_F(ServiceWorkerRegistrationTest, FailedRegistrationNoCrash) {

Powered by Google App Engine
This is Rietveld 408576698