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

Side by Side Diff: chrome/browser/extensions/extension_storage_monitor_browsertest.cc

Issue 757433004: Add SOURCE_TEST. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update existing browser tests to use the correct source. Created 6 years 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 unified diff | Download patch
OLDNEW
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 <set> 5 #include <set>
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "chrome/browser/extensions/extension_browsertest.h" 9 #include "chrome/browser/extensions/extension_browsertest.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // Write a number of bytes to persistent storage. 174 // Write a number of bytes to persistent storage.
175 void WriteBytes(const Extension* extension, 175 void WriteBytes(const Extension* extension,
176 int num_bytes, 176 int num_bytes,
177 bool expected_notification) { 177 bool expected_notification) {
178 ExtensionTestMessageListener launched_listener("launched", true); 178 ExtensionTestMessageListener launched_listener("launched", true);
179 ExtensionTestMessageListener write_complete_listener( 179 ExtensionTestMessageListener write_complete_listener(
180 "write_complete", false); 180 "write_complete", false);
181 NotificationObserver notification_observer( 181 NotificationObserver notification_observer(
182 GetNotificationId(extension->id())); 182 GetNotificationId(extension->id()));
183 183
184 OpenApplication(AppLaunchParams(profile(), extension, LAUNCH_CONTAINER_NONE, 184 OpenApplication(
185 NEW_WINDOW, extensions::SOURCE_UNTRACKED)); 185 AppLaunchParams(profile(), extension, LAUNCH_CONTAINER_NONE,
186 NEW_WINDOW, extensions::SOURCE_BROWSER_TEST));
186 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); 187 ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
187 188
188 // Instruct the app to write |num_bytes| of data. 189 // Instruct the app to write |num_bytes| of data.
189 launched_listener.Reply(base::IntToString(num_bytes)); 190 launched_listener.Reply(base::IntToString(num_bytes));
190 ASSERT_TRUE(write_complete_listener.WaitUntilSatisfied()); 191 ASSERT_TRUE(write_complete_listener.WaitUntilSatisfied());
191 192
192 if (expected_notification) { 193 if (expected_notification) {
193 EXPECT_TRUE(notification_observer.WaitForNotification()); 194 EXPECT_TRUE(notification_observer.WaitForNotification());
194 } else { 195 } else {
195 base::RunLoop().RunUntilIdle(); 196 base::RunLoop().RunUntilIdle();
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 ExtensionStorageMonitor::BUTTON_UNINSTALL); 334 ExtensionStorageMonitor::BUTTON_UNINSTALL);
334 335
335 // Also fake accepting the uninstall. 336 // Also fake accepting the uninstall.
336 TestExtensionRegistryObserver observer(ExtensionRegistry::Get(profile()), 337 TestExtensionRegistryObserver observer(ExtensionRegistry::Get(profile()),
337 extension->id()); 338 extension->id());
338 SimulateUninstallDialogAccept(); 339 SimulateUninstallDialogAccept();
339 observer.WaitForExtensionUninstalled(); 340 observer.WaitForExtensionUninstalled();
340 } 341 }
341 342
342 } // namespace extensions 343 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698