Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/apps/app_browsertest.cc

Issue 83633004: Do not spawn a thread in browser/interactive ui tests before spawning sandbox host process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style fix Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/crash_restore_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "apps/launcher.h" 5 #include "apps/launcher.h"
6 #include "apps/shell_window.h" 6 #include "apps/shell_window.h"
7 #include "apps/shell_window_registry.h" 7 #include "apps/shell_window_registry.h"
8 #include "apps/ui/native_app_window.h" 8 #include "apps/ui/native_app_window.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 // PlatformAppBrowserTest overrides 1228 // PlatformAppBrowserTest overrides
1229 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 1229 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
1230 PlatformAppBrowserTest::SetUpInProcessBrowserTestFixture(); 1230 PlatformAppBrowserTest::SetUpInProcessBrowserTestFixture();
1231 1231
1232 chromeos::FakeDBusThreadManager* dbus_manager = 1232 chromeos::FakeDBusThreadManager* dbus_manager =
1233 new chromeos::FakeDBusThreadManager; 1233 new chromeos::FakeDBusThreadManager;
1234 dbus_manager->SetFakeClients(); 1234 dbus_manager->SetFakeClients();
1235 power_manager_client_ = new chromeos::FakePowerManagerClient; 1235 power_manager_client_ = new chromeos::FakePowerManagerClient;
1236 dbus_manager->SetPowerManagerClient( 1236 dbus_manager->SetPowerManagerClient(
1237 scoped_ptr<chromeos::PowerManagerClient>(power_manager_client_)); 1237 scoped_ptr<chromeos::PowerManagerClient>(power_manager_client_));
1238 chromeos::DBusThreadManager::InitializeForTesting(dbus_manager); 1238 chromeos::DBusThreadManager::SetInstanceForTesting(dbus_manager);
1239 } 1239 }
1240 1240
1241 virtual void SetUpOnMainThread() OVERRIDE { 1241 virtual void SetUpOnMainThread() OVERRIDE {
1242 PlatformAppBrowserTest::SetUpOnMainThread(); 1242 PlatformAppBrowserTest::SetUpOnMainThread();
1243 1243
1244 mock_user_manager_ = new chromeos::MockUserManager; 1244 mock_user_manager_ = new chromeos::MockUserManager;
1245 user_manager_enabler_.reset( 1245 user_manager_enabler_.reset(
1246 new chromeos::ScopedUserManagerEnabler(mock_user_manager_)); 1246 new chromeos::ScopedUserManagerEnabler(mock_user_manager_));
1247 1247
1248 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) 1248 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn())
1249 .WillRepeatedly(testing::Return(true)); 1249 .WillRepeatedly(testing::Return(true));
1250 EXPECT_CALL(*mock_user_manager_, IsLoggedInAsKioskApp()) 1250 EXPECT_CALL(*mock_user_manager_, IsLoggedInAsKioskApp())
1251 .WillRepeatedly(testing::Return(true)); 1251 .WillRepeatedly(testing::Return(true));
1252 } 1252 }
1253 1253
1254 virtual void CleanUpOnMainThread() OVERRIDE { 1254 virtual void CleanUpOnMainThread() OVERRIDE {
1255 user_manager_enabler_.reset(); 1255 user_manager_enabler_.reset();
1256 PlatformAppBrowserTest::CleanUpOnMainThread(); 1256 PlatformAppBrowserTest::CleanUpOnMainThread();
1257 } 1257 }
1258 1258
1259 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { 1259 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE {
1260 chromeos::DBusThreadManager::Shutdown();
1261 PlatformAppBrowserTest::TearDownInProcessBrowserTestFixture(); 1260 PlatformAppBrowserTest::TearDownInProcessBrowserTestFixture();
1262 } 1261 }
1263 1262
1264 int request_restart_call_count() const { 1263 int request_restart_call_count() const {
1265 return power_manager_client_->request_restart_call_count(); 1264 return power_manager_client_->request_restart_call_count();
1266 } 1265 }
1267 1266
1268 private: 1267 private:
1269 chromeos::FakePowerManagerClient* power_manager_client_; 1268 chromeos::FakePowerManagerClient* power_manager_client_;
1270 chromeos::MockUserManager* mock_user_manager_; 1269 chromeos::MockUserManager* mock_user_manager_;
(...skipping 17 matching lines...) Expand all
1288 false); 1287 false);
1289 ASSERT_TRUE(restart_requested_listener.WaitUntilSatisfied()); 1288 ASSERT_TRUE(restart_requested_listener.WaitUntilSatisfied());
1290 1289
1291 EXPECT_EQ(1, request_restart_call_count()); 1290 EXPECT_EQ(1, request_restart_call_count());
1292 } 1291 }
1293 1292
1294 #endif // defined(OS_CHROMEOS) 1293 #endif // defined(OS_CHROMEOS)
1295 1294
1296 1295
1297 } // namespace extensions 1296 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/crash_restore_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698