OLD | NEW |
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(AppLaunchParams(profile(), extension, LAUNCH_CONTAINER_NONE, |
185 NEW_WINDOW, extensions::SOURCE_UNTRACKED)); | 185 NEW_WINDOW, extensions::SOURCE_TEST)); |
186 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 186 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
187 | 187 |
188 // Instruct the app to write |num_bytes| of data. | 188 // Instruct the app to write |num_bytes| of data. |
189 launched_listener.Reply(base::IntToString(num_bytes)); | 189 launched_listener.Reply(base::IntToString(num_bytes)); |
190 ASSERT_TRUE(write_complete_listener.WaitUntilSatisfied()); | 190 ASSERT_TRUE(write_complete_listener.WaitUntilSatisfied()); |
191 | 191 |
192 if (expected_notification) { | 192 if (expected_notification) { |
193 EXPECT_TRUE(notification_observer.WaitForNotification()); | 193 EXPECT_TRUE(notification_observer.WaitForNotification()); |
194 } else { | 194 } else { |
195 base::RunLoop().RunUntilIdle(); | 195 base::RunLoop().RunUntilIdle(); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 ExtensionStorageMonitor::BUTTON_UNINSTALL); | 333 ExtensionStorageMonitor::BUTTON_UNINSTALL); |
334 | 334 |
335 // Also fake accepting the uninstall. | 335 // Also fake accepting the uninstall. |
336 TestExtensionRegistryObserver observer(ExtensionRegistry::Get(profile()), | 336 TestExtensionRegistryObserver observer(ExtensionRegistry::Get(profile()), |
337 extension->id()); | 337 extension->id()); |
338 SimulateUninstallDialogAccept(); | 338 SimulateUninstallDialogAccept(); |
339 observer.WaitForExtensionUninstalled(); | 339 observer.WaitForExtensionUninstalled(); |
340 } | 340 } |
341 | 341 |
342 } // namespace extensions | 342 } // namespace extensions |
OLD | NEW |