| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
| 6 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
| 7 #include "chrome/browser/extensions/autoupdate_interceptor.h" | 7 #include "chrome/browser/extensions/autoupdate_interceptor.h" |
| 8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
| 9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/extensions/extension_test_message_listener.h" | 11 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 12 #include "chrome/browser/extensions/extension_updater.h" | 12 #include "chrome/browser/extensions/extension_updater.h" |
| 13 #include "chrome/browser/infobars/infobar_tab_helper.h" | 13 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 14 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
| 15 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 15 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 19 #include "chrome/common/chrome_notification_types.h" | 19 #include "chrome/common/chrome_notification_types.h" |
| 20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
| 21 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
| 22 #include "chrome/test/base/ui_test_utils.h" | 22 #include "chrome/test/base/ui_test_utils.h" |
| 23 #include "content/browser/renderer_host/render_view_host.h" | 23 #include "content/browser/renderer_host/render_view_host.h" |
| 24 #include "content/common/net/url_fetcher.h" |
| 24 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
| 25 | 26 |
| 26 class ExtensionManagementTest : public ExtensionBrowserTest { | 27 class ExtensionManagementTest : public ExtensionBrowserTest { |
| 27 protected: | 28 protected: |
| 28 // Helper method that returns whether the extension is at the given version. | 29 // Helper method that returns whether the extension is at the given version. |
| 29 // This calls version(), which must be defined in the extension's bg page, | 30 // This calls version(), which must be defined in the extension's bg page, |
| 30 // as well as asking the extension itself. | 31 // as well as asking the extension itself. |
| 31 // | 32 // |
| 32 // Note that 'version' here means something different than the version field | 33 // Note that 'version' here means something different than the version field |
| 33 // in the extension's manifest. We use the version as reported by the | 34 // in the extension's manifest. We use the version as reported by the |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 } | 605 } |
| 605 ASSERT_TRUE(WaitForExtensionInstall()); | 606 ASSERT_TRUE(WaitForExtensionInstall()); |
| 606 extensions = service->extensions(); | 607 extensions = service->extensions(); |
| 607 ASSERT_EQ(size_before + 1, extensions->size()); | 608 ASSERT_EQ(size_before + 1, extensions->size()); |
| 608 extension = extensions->at(size_before); | 609 extension = extensions->at(size_before); |
| 609 ASSERT_EQ(kExtensionId, extension->id()); | 610 ASSERT_EQ(kExtensionId, extension->id()); |
| 610 EXPECT_EQ(Extension::EXTERNAL_POLICY_DOWNLOAD, extension->location()); | 611 EXPECT_EQ(Extension::EXTERNAL_POLICY_DOWNLOAD, extension->location()); |
| 611 EXPECT_TRUE(service->IsExtensionEnabled(kExtensionId)); | 612 EXPECT_TRUE(service->IsExtensionEnabled(kExtensionId)); |
| 612 EXPECT_TRUE(service->disabled_extensions()->empty()); | 613 EXPECT_TRUE(service->disabled_extensions()->empty()); |
| 613 } | 614 } |
| OLD | NEW |