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

Unified Diff: content/browser/service_worker/service_worker_job_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_job_unittest.cc
diff --git a/content/browser/service_worker/service_worker_job_unittest.cc b/content/browser/service_worker/service_worker_job_unittest.cc
index 91ad2263292d59ed1ee46083e7bedb3a8cc5195d..515e0f82fdc896a1a2099d7b16e9dc2a5d738187 100644
--- a/content/browser/service_worker/service_worker_job_unittest.cc
+++ b/content/browser/service_worker/service_worker_job_unittest.cc
@@ -1068,25 +1068,34 @@ TEST_F(ServiceWorkerJobTest, Update_NewVersion) {
EXPECT_TRUE(entry.mask.installing_changed());
EXPECT_FALSE(entry.mask.waiting_changed());
EXPECT_FALSE(entry.mask.active_changed());
- EXPECT_FALSE(entry.info.installing_version.is_null);
- EXPECT_TRUE(entry.info.waiting_version.is_null);
- EXPECT_FALSE(entry.info.active_version.is_null);
+ EXPECT_NE(entry.info.installing_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_EQ(entry.info.waiting_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_NE(entry.info.active_version.version_id,
+ kInvalidServiceWorkerVersionId);
entry = update_helper->attribute_change_log_[1];
EXPECT_TRUE(entry.mask.installing_changed());
EXPECT_TRUE(entry.mask.waiting_changed());
EXPECT_FALSE(entry.mask.active_changed());
- EXPECT_TRUE(entry.info.installing_version.is_null);
- EXPECT_FALSE(entry.info.waiting_version.is_null);
- EXPECT_FALSE(entry.info.active_version.is_null);
+ EXPECT_EQ(entry.info.installing_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_NE(entry.info.waiting_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_NE(entry.info.active_version.version_id,
+ kInvalidServiceWorkerVersionId);
entry = update_helper->attribute_change_log_[2];
EXPECT_FALSE(entry.mask.installing_changed());
EXPECT_TRUE(entry.mask.waiting_changed());
EXPECT_TRUE(entry.mask.active_changed());
- EXPECT_TRUE(entry.info.installing_version.is_null);
- EXPECT_TRUE(entry.info.waiting_version.is_null);
- EXPECT_FALSE(entry.info.active_version.is_null);
+ EXPECT_EQ(entry.info.installing_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_EQ(entry.info.waiting_version.version_id,
+ kInvalidServiceWorkerVersionId);
+ EXPECT_NE(entry.info.active_version.version_id,
+ kInvalidServiceWorkerVersionId);
// expected version state transitions:
// new.installing, new.installed,

Powered by Google App Engine
This is Rietveld 408576698