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" |
11 #include "chrome/browser/extensions/extension_storage_monitor.h" | 11 #include "chrome/browser/extensions/extension_storage_monitor.h" |
12 #include "chrome/browser/ui/extensions/app_launch_params.h" | 12 #include "chrome/browser/ui/extensions/app_launch_params.h" |
13 #include "chrome/browser/ui/extensions/application_launch.h" | 13 #include "chrome/browser/ui/extensions/application_launch.h" |
14 #include "content/public/test/test_utils.h" | 14 #include "content/public/test/test_utils.h" |
| 15 #include "extensions/browser/extension_dialog_auto_confirm.h" |
15 #include "extensions/browser/extension_prefs.h" | 16 #include "extensions/browser/extension_prefs.h" |
16 #include "extensions/browser/extension_registry.h" | 17 #include "extensions/browser/extension_registry.h" |
17 #include "extensions/browser/extension_system.h" | 18 #include "extensions/browser/extension_system.h" |
18 #include "extensions/browser/test_extension_registry_observer.h" | 19 #include "extensions/browser/test_extension_registry_observer.h" |
19 #include "extensions/common/constants.h" | 20 #include "extensions/common/constants.h" |
20 #include "extensions/test/extension_test_message_listener.h" | 21 #include "extensions/test/extension_test_message_listener.h" |
21 #include "ui/message_center/message_center.h" | 22 #include "ui/message_center/message_center.h" |
22 #include "ui/message_center/message_center_observer.h" | 23 #include "ui/message_center/message_center_observer.h" |
23 | 24 |
24 namespace extensions { | 25 namespace extensions { |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 317 |
317 // Verify that notifications are disabled when the user clicks the action button | 318 // Verify that notifications are disabled when the user clicks the action button |
318 // in the notification. | 319 // in the notification. |
319 IN_PROC_BROWSER_TEST_F(ExtensionStorageMonitorTest, UninstallExtension) { | 320 IN_PROC_BROWSER_TEST_F(ExtensionStorageMonitorTest, UninstallExtension) { |
320 const Extension* extension = InitWriteDataApp(); | 321 const Extension* extension = InitWriteDataApp(); |
321 ASSERT_TRUE(extension); | 322 ASSERT_TRUE(extension); |
322 WriteBytesExpectingNotification(extension, GetInitialExtensionThreshold()); | 323 WriteBytesExpectingNotification(extension, GetInitialExtensionThreshold()); |
323 | 324 |
324 // Fake clicking the notification button to uninstall and accepting the | 325 // Fake clicking the notification button to uninstall and accepting the |
325 // uninstall. | 326 // uninstall. |
326 ExtensionUninstallDialog::ScopedAutoConfirm scoped_autoconfirm( | 327 ScopedTestDialogAutoConfirm scoped_autoconfirm( |
327 ExtensionUninstallDialog::ACCEPT); | 328 ScopedTestDialogAutoConfirm::ACCEPT); |
328 TestExtensionRegistryObserver observer(ExtensionRegistry::Get(profile()), | 329 TestExtensionRegistryObserver observer(ExtensionRegistry::Get(profile()), |
329 extension->id()); | 330 extension->id()); |
330 message_center::MessageCenter::Get()->ClickOnNotificationButton( | 331 message_center::MessageCenter::Get()->ClickOnNotificationButton( |
331 GetNotificationId(extension->id()), | 332 GetNotificationId(extension->id()), |
332 ExtensionStorageMonitor::BUTTON_UNINSTALL); | 333 ExtensionStorageMonitor::BUTTON_UNINSTALL); |
333 observer.WaitForExtensionUninstalled(); | 334 observer.WaitForExtensionUninstalled(); |
334 } | 335 } |
335 | 336 |
336 } // namespace extensions | 337 } // namespace extensions |
OLD | NEW |