| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 void WriteBytes(const Extension* extension, | 153 void WriteBytes(const Extension* extension, |
| 154 int num_bytes, | 154 int num_bytes, |
| 155 bool expected_notification) { | 155 bool expected_notification) { |
| 156 ExtensionTestMessageListener launched_listener("launched", true); | 156 ExtensionTestMessageListener launched_listener("launched", true); |
| 157 ExtensionTestMessageListener write_complete_listener( | 157 ExtensionTestMessageListener write_complete_listener( |
| 158 "write_complete", false); | 158 "write_complete", false); |
| 159 NotificationObserver notification_observer( | 159 NotificationObserver notification_observer( |
| 160 GetNotificationId(extension->id())); | 160 GetNotificationId(extension->id())); |
| 161 | 161 |
| 162 OpenApplication(AppLaunchParams(profile(), extension, LAUNCH_CONTAINER_NONE, | 162 OpenApplication(AppLaunchParams(profile(), extension, LAUNCH_CONTAINER_NONE, |
| 163 NEW_WINDOW, extensions::SOURCE_TEST)); | 163 WindowOpenDisposition::NEW_WINDOW, |
| 164 extensions::SOURCE_TEST)); |
| 164 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 165 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
| 165 | 166 |
| 166 // Instruct the app to write |num_bytes| of data. | 167 // Instruct the app to write |num_bytes| of data. |
| 167 launched_listener.Reply(base::IntToString(num_bytes)); | 168 launched_listener.Reply(base::IntToString(num_bytes)); |
| 168 ASSERT_TRUE(write_complete_listener.WaitUntilSatisfied()); | 169 ASSERT_TRUE(write_complete_listener.WaitUntilSatisfied()); |
| 169 | 170 |
| 170 if (expected_notification) { | 171 if (expected_notification) { |
| 171 EXPECT_TRUE(notification_observer.WaitForNotification()); | 172 EXPECT_TRUE(notification_observer.WaitForNotification()); |
| 172 } else { | 173 } else { |
| 173 base::RunLoop().RunUntilIdle(); | 174 base::RunLoop().RunUntilIdle(); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 ScopedTestDialogAutoConfirm::ACCEPT); | 268 ScopedTestDialogAutoConfirm::ACCEPT); |
| 268 TestExtensionRegistryObserver observer(ExtensionRegistry::Get(profile()), | 269 TestExtensionRegistryObserver observer(ExtensionRegistry::Get(profile()), |
| 269 extension->id()); | 270 extension->id()); |
| 270 message_center::MessageCenter::Get()->ClickOnNotificationButton( | 271 message_center::MessageCenter::Get()->ClickOnNotificationButton( |
| 271 GetNotificationId(extension->id()), | 272 GetNotificationId(extension->id()), |
| 272 ExtensionStorageMonitor::BUTTON_UNINSTALL); | 273 ExtensionStorageMonitor::BUTTON_UNINSTALL); |
| 273 observer.WaitForExtensionUninstalled(); | 274 observer.WaitForExtensionUninstalled(); |
| 274 } | 275 } |
| 275 | 276 |
| 276 } // namespace extensions | 277 } // namespace extensions |
| OLD | NEW |