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 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/extensions/extension_install_prompt.h" | 22 #include "chrome/browser/extensions/extension_install_prompt.h" |
23 #include "chrome/browser/extensions/extension_service.h" | 23 #include "chrome/browser/extensions/extension_service.h" |
24 #include "chrome/browser/extensions/unpacked_installer.h" | 24 #include "chrome/browser/extensions/unpacked_installer.h" |
25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
26 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
27 #include "chrome/browser/ui/browser_window.h" | 27 #include "chrome/browser/ui/browser_window.h" |
28 #include "chrome/browser/ui/omnibox/location_bar.h" | 28 #include "chrome/browser/ui/omnibox/location_bar.h" |
29 #include "chrome/common/chrome_notification_types.h" | 29 #include "chrome/common/chrome_notification_types.h" |
30 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
31 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| 32 #include "chrome/common/extensions/features/feature.h" |
32 #include "chrome/test/base/ui_test_utils.h" | 33 #include "chrome/test/base/ui_test_utils.h" |
33 #include "content/public/browser/navigation_controller.h" | 34 #include "content/public/browser/navigation_controller.h" |
34 #include "content/public/browser/navigation_entry.h" | 35 #include "content/public/browser/navigation_entry.h" |
35 #include "content/public/browser/notification_registrar.h" | 36 #include "content/public/browser/notification_registrar.h" |
36 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
37 #include "content/public/browser/render_view_host.h" | 38 #include "content/public/browser/render_view_host.h" |
38 | 39 |
39 using extensions::Extension; | 40 using extensions::Extension; |
40 | 41 |
41 ExtensionBrowserTest::ExtensionBrowserTest() | 42 ExtensionBrowserTest::ExtensionBrowserTest() |
42 : loaded_(false), | 43 : loaded_(false), |
43 installed_(false), | 44 installed_(false), |
44 extension_installs_observed_(0), | 45 extension_installs_observed_(0), |
45 extension_load_errors_observed_(0), | 46 extension_load_errors_observed_(0), |
46 target_page_action_count_(-1), | 47 target_page_action_count_(-1), |
47 target_visible_page_action_count_(-1) { | 48 target_visible_page_action_count_(-1) { |
48 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); | 49 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); |
49 AppShortcutManager::SetShortcutCreationDisabledForTesting(true); | 50 AppShortcutManager::SetShortcutCreationDisabledForTesting(true); |
50 } | 51 } |
51 | 52 |
52 ExtensionBrowserTest::~ExtensionBrowserTest() { | 53 ExtensionBrowserTest::~ExtensionBrowserTest() { |
53 AppShortcutManager::SetShortcutCreationDisabledForTesting(false); | 54 AppShortcutManager::SetShortcutCreationDisabledForTesting(false); |
54 } | 55 } |
55 | 56 |
56 void ExtensionBrowserTest::SetUpCommandLine(CommandLine* command_line) { | 57 void ExtensionBrowserTest::SetUpCommandLine(CommandLine* command_line) { |
57 // This enables DOM automation for tab contentses. | 58 // This enables DOM automation for tab contentses. |
58 EnableDOMAutomation(); | 59 EnableDOMAutomation(); |
59 | 60 |
| 61 extensions::Feature::SetChannelForTesting( |
| 62 chrome::VersionInfo::CHANNEL_UNKNOWN); |
| 63 |
60 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); | 64 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); |
61 test_data_dir_ = test_data_dir_.AppendASCII("extensions"); | 65 test_data_dir_ = test_data_dir_.AppendASCII("extensions"); |
62 | 66 |
63 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
64 // This makes sure that we create the Default profile first, with no | 68 // This makes sure that we create the Default profile first, with no |
65 // ExtensionService and then the real profile with one, as we do when | 69 // ExtensionService and then the real profile with one, as we do when |
66 // running on chromeos. | 70 // running on chromeos. |
67 command_line->AppendSwitchASCII(switches::kLoginUser, | 71 command_line->AppendSwitchASCII(switches::kLoginUser, |
68 "TestUser@gmail.com"); | 72 "TestUser@gmail.com"); |
69 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); | 73 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 case content::NOTIFICATION_LOAD_STOP: | 633 case content::NOTIFICATION_LOAD_STOP: |
630 VLOG(1) << "Got LOAD_STOP notification."; | 634 VLOG(1) << "Got LOAD_STOP notification."; |
631 MessageLoopForUI::current()->Quit(); | 635 MessageLoopForUI::current()->Quit(); |
632 break; | 636 break; |
633 | 637 |
634 default: | 638 default: |
635 NOTREACHED(); | 639 NOTREACHED(); |
636 break; | 640 break; |
637 } | 641 } |
638 } | 642 } |
OLD | NEW |