| 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_path.h" | 10 #include "base/file_path.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/ui/browser.h" | 28 #include "chrome/browser/ui/browser.h" |
| 29 #include "chrome/browser/ui/browser_window.h" | 29 #include "chrome/browser/ui/browser_window.h" |
| 30 #include "chrome/browser/ui/extensions/native_app_window.h" | 30 #include "chrome/browser/ui/extensions/native_app_window.h" |
| 31 #include "chrome/browser/ui/extensions/shell_window.h" | 31 #include "chrome/browser/ui/extensions/shell_window.h" |
| 32 #include "chrome/browser/ui/omnibox/location_bar.h" | 32 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 33 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 33 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 34 #include "chrome/common/chrome_notification_types.h" | 34 #include "chrome/common/chrome_notification_types.h" |
| 35 #include "chrome/common/chrome_paths.h" | 35 #include "chrome/common/chrome_paths.h" |
| 36 #include "chrome/common/chrome_switches.h" | 36 #include "chrome/common/chrome_switches.h" |
| 37 #include "chrome/common/chrome_version_info.h" | 37 #include "chrome/common/chrome_version_info.h" |
| 38 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 39 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 40 #include "chrome/common/extensions/manifest_handler.h" |
| 38 #include "chrome/test/base/ui_test_utils.h" | 41 #include "chrome/test/base/ui_test_utils.h" |
| 39 #include "content/public/browser/navigation_controller.h" | 42 #include "content/public/browser/navigation_controller.h" |
| 40 #include "content/public/browser/navigation_entry.h" | 43 #include "content/public/browser/navigation_entry.h" |
| 41 #include "content/public/browser/notification_registrar.h" | 44 #include "content/public/browser/notification_registrar.h" |
| 42 #include "content/public/browser/notification_service.h" | 45 #include "content/public/browser/notification_service.h" |
| 43 #include "content/public/browser/render_view_host.h" | 46 #include "content/public/browser/render_view_host.h" |
| 44 #include "content/public/test/browser_test_utils.h" | 47 #include "content/public/test/browser_test_utils.h" |
| 45 #include "sync/api/string_ordinal.h" | 48 #include "sync/api/string_ordinal.h" |
| 46 | 49 |
| 47 using extensions::Extension; | 50 using extensions::Extension; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 72 #if defined(OS_CHROMEOS) | 75 #if defined(OS_CHROMEOS) |
| 73 // This makes sure that we create the Default profile first, with no | 76 // This makes sure that we create the Default profile first, with no |
| 74 // ExtensionService and then the real profile with one, as we do when | 77 // ExtensionService and then the real profile with one, as we do when |
| 75 // running on chromeos. | 78 // running on chromeos. |
| 76 command_line->AppendSwitchASCII(switches::kLoginUser, | 79 command_line->AppendSwitchASCII(switches::kLoginUser, |
| 77 "TestUser@gmail.com"); | 80 "TestUser@gmail.com"); |
| 78 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); | 81 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); |
| 79 #endif | 82 #endif |
| 80 } | 83 } |
| 81 | 84 |
| 85 void ExtensionBrowserTest::SetUpOnMainThread() { |
| 86 InProcessBrowserTest::SetUpOnMainThread(); |
| 87 extensions::ManifestHandler::Register(extension_manifest_keys::kIcons, |
| 88 new extensions::IconsHandler); |
| 89 } |
| 90 |
| 82 const Extension* ExtensionBrowserTest::LoadExtensionWithFlags( | 91 const Extension* ExtensionBrowserTest::LoadExtensionWithFlags( |
| 83 const FilePath& path, int flags) { | 92 const FilePath& path, int flags) { |
| 84 ExtensionService* service = extensions::ExtensionSystem::Get( | 93 ExtensionService* service = extensions::ExtensionSystem::Get( |
| 85 browser()->profile())->extension_service(); | 94 browser()->profile())->extension_service(); |
| 86 { | 95 { |
| 87 content::NotificationRegistrar registrar; | 96 content::NotificationRegistrar registrar; |
| 88 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 97 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
| 89 content::NotificationService::AllSources()); | 98 content::NotificationService::AllSources()); |
| 90 scoped_refptr<extensions::UnpackedInstaller> installer( | 99 scoped_refptr<extensions::UnpackedInstaller> installer( |
| 91 extensions::UnpackedInstaller::Create(service)); | 100 extensions::UnpackedInstaller::Create(service)); |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 case content::NOTIFICATION_LOAD_STOP: | 698 case content::NOTIFICATION_LOAD_STOP: |
| 690 VLOG(1) << "Got LOAD_STOP notification."; | 699 VLOG(1) << "Got LOAD_STOP notification."; |
| 691 MessageLoopForUI::current()->Quit(); | 700 MessageLoopForUI::current()->Quit(); |
| 692 break; | 701 break; |
| 693 | 702 |
| 694 default: | 703 default: |
| 695 NOTREACHED(); | 704 NOTREACHED(); |
| 696 break; | 705 break; |
| 697 } | 706 } |
| 698 } | 707 } |
| OLD | NEW |