| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // ExtensionService and then the real profile with one, as we do when | 120 // ExtensionService and then the real profile with one, as we do when |
| 121 // running on chromeos. | 121 // running on chromeos. |
| 122 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, | 122 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, |
| 123 "TestUser@gmail.com"); | 123 "TestUser@gmail.com"); |
| 124 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); | 124 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); |
| 125 #endif | 125 #endif |
| 126 } | 126 } |
| 127 | 127 |
| 128 void ExtensionBrowserTest::SetUpOnMainThread() { | 128 void ExtensionBrowserTest::SetUpOnMainThread() { |
| 129 InProcessBrowserTest::SetUpOnMainThread(); | 129 InProcessBrowserTest::SetUpOnMainThread(); |
| 130 // Wait for the InstantNTP prerendered contents to load. |
| 131 content::WindowedNotificationObserver observer( |
| 132 content::NOTIFICATION_LOAD_STOP, |
| 133 content::NotificationService::AllSources()); |
| 134 observer.Wait(); |
| 130 } | 135 } |
| 131 | 136 |
| 132 const Extension* ExtensionBrowserTest::LoadExtensionWithFlags( | 137 const Extension* ExtensionBrowserTest::LoadExtensionWithFlags( |
| 133 const base::FilePath& path, int flags) { | 138 const base::FilePath& path, int flags) { |
| 134 ExtensionService* service = extensions::ExtensionSystem::Get( | 139 ExtensionService* service = extensions::ExtensionSystem::Get( |
| 135 profile())->extension_service(); | 140 profile())->extension_service(); |
| 136 { | 141 { |
| 137 content::WindowedNotificationObserver observer( | 142 content::WindowedNotificationObserver observer( |
| 138 chrome::NOTIFICATION_EXTENSION_LOADED, | 143 chrome::NOTIFICATION_EXTENSION_LOADED, |
| 139 content::NotificationService::AllSources()); | 144 content::NotificationService::AllSources()); |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 case chrome::NOTIFICATION_EXTENSION_LOAD_ERROR: | 757 case chrome::NOTIFICATION_EXTENSION_LOAD_ERROR: |
| 753 VLOG(1) << "Got EXTENSION_LOAD_ERROR notification."; | 758 VLOG(1) << "Got EXTENSION_LOAD_ERROR notification."; |
| 754 ++extension_load_errors_observed_; | 759 ++extension_load_errors_observed_; |
| 755 break; | 760 break; |
| 756 | 761 |
| 757 default: | 762 default: |
| 758 NOTREACHED(); | 763 NOTREACHED(); |
| 759 break; | 764 break; |
| 760 } | 765 } |
| 761 } | 766 } |
| OLD | NEW |