Index: chrome/browser/chromeos/drive/drive_app_registry_unittest.cc |
diff --git a/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc b/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc |
index 6228f425900929b429873627723c4d0175283bca..eacfae625b7da832653edfd74e289c0b5a833deb 100644 |
--- a/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc |
+++ b/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc |
@@ -30,8 +30,6 @@ class DriveAppRegistryTest : public testing::Test { |
base::MessageLoopProxy::current().get())); |
web_apps_registry_.reset(new DriveAppRegistry(scheduler_.get())); |
- web_apps_registry_->Update(); |
- base::RunLoop().RunUntilIdle(); |
} |
bool VerifyApp(const ScopedVector<DriveAppInfo>& list, |
@@ -54,7 +52,7 @@ class DriveAppRegistryTest : public testing::Test { |
} |
} |
EXPECT_TRUE(found) << "Unable to find app with web_store_id " |
- << web_store_id; |
+ << web_store_id; |
return found; |
} |
@@ -66,6 +64,9 @@ class DriveAppRegistryTest : public testing::Test { |
}; |
TEST_F(DriveAppRegistryTest, LoadAndFindDriveApps) { |
+ web_apps_registry_->Update(); |
+ base::RunLoop().RunUntilIdle(); |
+ |
// Find by primary extension 'exe'. |
ScopedVector<DriveAppInfo> ext_results; |
base::FilePath ext_file(FILE_PATH_LITERAL("drive/file.exe")); |
@@ -91,4 +92,17 @@ TEST_F(DriveAppRegistryTest, LoadAndFindDriveApps) { |
"Drive app 1", "", false); |
} |
+TEST_F(DriveAppRegistryTest, MultipleUpdate) { |
+ // Call Update(). |
+ web_apps_registry_->Update(); |
+ |
+ // Call Update() again. |
+ // This call should be ignored because there is already an ongoing update. |
+ web_apps_registry_->Update(); |
+ |
+ // The app list should be loaded only once. |
+ base::RunLoop().RunUntilIdle(); |
+ EXPECT_EQ(1, fake_drive_service_->app_list_load_count()); |
+} |
+ |
} // namespace drive |