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

Side by Side Diff: chrome/browser/chromeos/login/auto_launched_kiosk_browsertest.cc

Issue 2832153003: Move calling of shared browser test methods like SetUpOnMainThread/TearDownOnMainThread/RunTestOn... (Closed)
Patch Set: sync Created 3 years, 8 months 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <memory> 5 #include <memory>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "apps/test/app_window_waiter.h" 9 #include "apps/test/app_window_waiter.h"
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 owner_key_util_->SetPublicKeyFromPrivateKey( 317 owner_key_util_->SetPublicKeyFromPrivateKey(
318 *device_policy_.GetSigningKey()); 318 *device_policy_.GetSigningKey());
319 319
320 fake_session_manager_->set_device_policy(device_policy_.GetBlob()); 320 fake_session_manager_->set_device_policy(device_policy_.GetBlob());
321 DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( 321 DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient(
322 std::move(fake_session_manager_)); 322 std::move(fake_session_manager_));
323 323
324 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); 324 ExtensionApiTest::SetUpInProcessBrowserTestFixture();
325 } 325 }
326 326
327 void PreRunTestOnMainThread() override {
328 termination_observer_.reset(new TerminationObserver());
329 InProcessBrowserTest::PreRunTestOnMainThread();
330 }
331
327 void SetUpOnMainThread() override { 332 void SetUpOnMainThread() override {
328 extensions::browsertest_util::CreateAndInitializeLocalCache(); 333 extensions::browsertest_util::CreateAndInitializeLocalCache();
329 334
330 embedded_test_server()->StartAcceptingConnections(); 335 embedded_test_server()->StartAcceptingConnections();
331 336
332 ExtensionApiTest::SetUpOnMainThread(); 337 ExtensionApiTest::SetUpOnMainThread();
333 } 338 }
334 339
335 void RunTestOnMainThreadLoop() override {
336 termination_observer_.reset(new TerminationObserver());
337
338 ExtensionApiTest::RunTestOnMainThreadLoop();
339 }
340
341 void TearDownOnMainThread() override { 340 void TearDownOnMainThread() override {
342 termination_observer_.reset(); 341 termination_observer_.reset();
343 342
344 ExtensionApiTest::TearDownOnMainThread(); 343 ExtensionApiTest::TearDownOnMainThread();
345 } 344 }
346 345
347 void InitDevicePolicy() { 346 void InitDevicePolicy() {
348 // Create device policy, and cache it to local state. 347 // Create device policy, and cache it to local state.
349 em::DeviceLocalAccountsProto* const device_local_accounts = 348 em::DeviceLocalAccountsProto* const device_local_accounts =
350 device_policy_.payload().mutable_device_local_accounts(); 349 device_policy_.payload().mutable_device_local_accounts();
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 ->SetupDefaultEnvironment(); 519 ->SetupDefaultEnvironment();
521 520
522 // App launch should be canceled, and user session stopped. 521 // App launch should be canceled, and user session stopped.
523 termination_waiter.Wait(); 522 termination_waiter.Wait();
524 523
525 EXPECT_FALSE(listener.was_satisfied()); 524 EXPECT_FALSE(listener.was_satisfied());
526 EXPECT_EQ(KioskAppLaunchError::NOT_KIOSK_ENABLED, KioskAppLaunchError::Get()); 525 EXPECT_EQ(KioskAppLaunchError::NOT_KIOSK_ENABLED, KioskAppLaunchError::Get());
527 } 526 }
528 527
529 } // namespace chromeos 528 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698