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 28 matching lines...) Expand all Loading... |
39 #include "chrome/test/base/ui_test_utils.h" | 39 #include "chrome/test/base/ui_test_utils.h" |
40 #include "content/public/browser/navigation_controller.h" | 40 #include "content/public/browser/navigation_controller.h" |
41 #include "content/public/browser/navigation_entry.h" | 41 #include "content/public/browser/navigation_entry.h" |
42 #include "content/public/browser/notification_registrar.h" | 42 #include "content/public/browser/notification_registrar.h" |
43 #include "content/public/browser/notification_service.h" | 43 #include "content/public/browser/notification_service.h" |
44 #include "content/public/browser/render_view_host.h" | 44 #include "content/public/browser/render_view_host.h" |
45 #include "content/public/test/browser_test_utils.h" | 45 #include "content/public/test/browser_test_utils.h" |
46 #include "extensions/common/constants.h" | 46 #include "extensions/common/constants.h" |
47 #include "sync/api/string_ordinal.h" | 47 #include "sync/api/string_ordinal.h" |
48 | 48 |
| 49 #if defined(OS_CHROMEOS) |
| 50 #include "chromeos/chromeos_switches.h" |
| 51 #endif |
| 52 |
49 using extensions::Extension; | 53 using extensions::Extension; |
50 using extensions::ExtensionCreator; | 54 using extensions::ExtensionCreator; |
51 using extensions::FeatureSwitch; | 55 using extensions::FeatureSwitch; |
52 using extensions::Manifest; | 56 using extensions::Manifest; |
53 | 57 |
54 ExtensionBrowserTest::ExtensionBrowserTest() | 58 ExtensionBrowserTest::ExtensionBrowserTest() |
55 : loaded_(false), | 59 : loaded_(false), |
56 installed_(false), | 60 installed_(false), |
57 extension_installs_observed_(0), | 61 extension_installs_observed_(0), |
58 extension_load_errors_observed_(0), | 62 extension_load_errors_observed_(0), |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 98 } |
95 | 99 |
96 void ExtensionBrowserTest::SetUpCommandLine(CommandLine* command_line) { | 100 void ExtensionBrowserTest::SetUpCommandLine(CommandLine* command_line) { |
97 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); | 101 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); |
98 test_data_dir_ = test_data_dir_.AppendASCII("extensions"); | 102 test_data_dir_ = test_data_dir_.AppendASCII("extensions"); |
99 | 103 |
100 #if defined(OS_CHROMEOS) | 104 #if defined(OS_CHROMEOS) |
101 // This makes sure that we create the Default profile first, with no | 105 // 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 | 106 // ExtensionService and then the real profile with one, as we do when |
103 // running on chromeos. | 107 // running on chromeos. |
104 command_line->AppendSwitchASCII(switches::kLoginUser, | 108 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, |
105 "TestUser@gmail.com"); | 109 "TestUser@gmail.com"); |
106 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); | 110 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); |
107 #endif | 111 #endif |
108 } | 112 } |
109 | 113 |
110 void ExtensionBrowserTest::SetUpOnMainThread() { | 114 void ExtensionBrowserTest::SetUpOnMainThread() { |
111 InProcessBrowserTest::SetUpOnMainThread(); | 115 InProcessBrowserTest::SetUpOnMainThread(); |
112 } | 116 } |
113 | 117 |
114 const Extension* ExtensionBrowserTest::LoadExtensionWithFlags( | 118 const Extension* ExtensionBrowserTest::LoadExtensionWithFlags( |
115 const base::FilePath& path, int flags) { | 119 const base::FilePath& path, int flags) { |
116 ExtensionService* service = extensions::ExtensionSystem::Get( | 120 ExtensionService* service = extensions::ExtensionSystem::Get( |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 case content::NOTIFICATION_LOAD_STOP: | 731 case content::NOTIFICATION_LOAD_STOP: |
728 VLOG(1) << "Got LOAD_STOP notification."; | 732 VLOG(1) << "Got LOAD_STOP notification."; |
729 MessageLoopForUI::current()->Quit(); | 733 MessageLoopForUI::current()->Quit(); |
730 break; | 734 break; |
731 | 735 |
732 default: | 736 default: |
733 NOTREACHED(); | 737 NOTREACHED(); |
734 break; | 738 break; |
735 } | 739 } |
736 } | 740 } |
OLD | NEW |