| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/extension_browsertest.h" | 5 #include "chrome/browser/extensions/extension_browsertest.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/ui/browser.h" | 29 #include "chrome/browser/ui/browser.h" |
| 30 #include "chrome/browser/ui/browser_window.h" | 30 #include "chrome/browser/ui/browser_window.h" |
| 31 #include "chrome/browser/ui/extensions/native_app_window.h" | 31 #include "chrome/browser/ui/extensions/native_app_window.h" |
| 32 #include "chrome/browser/ui/extensions/shell_window.h" | 32 #include "chrome/browser/ui/extensions/shell_window.h" |
| 33 #include "chrome/browser/ui/omnibox/location_bar.h" | 33 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 34 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 34 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 35 #include "chrome/common/chrome_notification_types.h" | 35 #include "chrome/common/chrome_notification_types.h" |
| 36 #include "chrome/common/chrome_paths.h" | 36 #include "chrome/common/chrome_paths.h" |
| 37 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
| 38 #include "chrome/common/chrome_version_info.h" | 38 #include "chrome/common/chrome_version_info.h" |
| 39 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 40 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 39 #include "chrome/common/extensions/extension_set.h" | 41 #include "chrome/common/extensions/extension_set.h" |
| 42 #include "chrome/common/extensions/manifest_handler.h" |
| 40 #include "chrome/test/base/ui_test_utils.h" | 43 #include "chrome/test/base/ui_test_utils.h" |
| 41 #include "content/public/browser/navigation_controller.h" | 44 #include "content/public/browser/navigation_controller.h" |
| 42 #include "content/public/browser/navigation_entry.h" | 45 #include "content/public/browser/navigation_entry.h" |
| 43 #include "content/public/browser/notification_registrar.h" | 46 #include "content/public/browser/notification_registrar.h" |
| 44 #include "content/public/browser/notification_service.h" | 47 #include "content/public/browser/notification_service.h" |
| 45 #include "content/public/browser/render_view_host.h" | 48 #include "content/public/browser/render_view_host.h" |
| 46 #include "content/public/test/browser_test_utils.h" | 49 #include "content/public/test/browser_test_utils.h" |
| 47 #include "sync/api/string_ordinal.h" | 50 #include "sync/api/string_ordinal.h" |
| 48 | 51 |
| 49 using extensions::Extension; | 52 using extensions::Extension; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 #if defined(OS_CHROMEOS) | 103 #if defined(OS_CHROMEOS) |
| 101 // This makes sure that we create the Default profile first, with no | 104 // This makes sure that we create the Default profile first, with no |
| 102 // ExtensionService and then the real profile with one, as we do when | 105 // ExtensionService and then the real profile with one, as we do when |
| 103 // running on chromeos. | 106 // running on chromeos. |
| 104 command_line->AppendSwitchASCII(switches::kLoginUser, | 107 command_line->AppendSwitchASCII(switches::kLoginUser, |
| 105 "TestUser@gmail.com"); | 108 "TestUser@gmail.com"); |
| 106 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); | 109 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); |
| 107 #endif | 110 #endif |
| 108 } | 111 } |
| 109 | 112 |
| 113 void ExtensionBrowserTest::SetUpOnMainThread() { |
| 114 InProcessBrowserTest::SetUpOnMainThread(); |
| 115 extensions::ManifestHandler::Register( |
| 116 extension_manifest_keys::kIcons, |
| 117 make_linked_ptr(new extensions::IconsHandler)); |
| 118 } |
| 119 |
| 110 const Extension* ExtensionBrowserTest::LoadExtensionWithFlags( | 120 const Extension* ExtensionBrowserTest::LoadExtensionWithFlags( |
| 111 const base::FilePath& path, int flags) { | 121 const base::FilePath& path, int flags) { |
| 112 ExtensionService* service = extensions::ExtensionSystem::Get( | 122 ExtensionService* service = extensions::ExtensionSystem::Get( |
| 113 profile())->extension_service(); | 123 profile())->extension_service(); |
| 114 { | 124 { |
| 115 content::NotificationRegistrar registrar; | 125 content::NotificationRegistrar registrar; |
| 116 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 126 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
| 117 content::NotificationService::AllSources()); | 127 content::NotificationService::AllSources()); |
| 118 scoped_refptr<extensions::UnpackedInstaller> installer( | 128 scoped_refptr<extensions::UnpackedInstaller> installer( |
| 119 extensions::UnpackedInstaller::Create(service)); | 129 extensions::UnpackedInstaller::Create(service)); |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 case content::NOTIFICATION_LOAD_STOP: | 733 case content::NOTIFICATION_LOAD_STOP: |
| 724 VLOG(1) << "Got LOAD_STOP notification."; | 734 VLOG(1) << "Got LOAD_STOP notification."; |
| 725 MessageLoopForUI::current()->Quit(); | 735 MessageLoopForUI::current()->Quit(); |
| 726 break; | 736 break; |
| 727 | 737 |
| 728 default: | 738 default: |
| 729 NOTREACHED(); | 739 NOTREACHED(); |
| 730 break; | 740 break; |
| 731 } | 741 } |
| 732 } | 742 } |
| OLD | NEW |