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

Side by Side Diff: chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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 (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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/process/process.h" 7 #include "base/process/process.h"
8 #include "base/test/test_timeouts.h" 8 #include "base/test/test_timeouts.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/devtools/devtools_window.h" 10 #include "chrome/browser/devtools/devtools_window.h"
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 class ChromeRenderProcessHostBackgroundingTest 544 class ChromeRenderProcessHostBackgroundingTest
545 : public ChromeRenderProcessHostTest { 545 : public ChromeRenderProcessHostTest {
546 public: 546 public:
547 ChromeRenderProcessHostBackgroundingTest() {} 547 ChromeRenderProcessHostBackgroundingTest() {}
548 548
549 void SetUpCommandLine(base::CommandLine* command_line) override { 549 void SetUpCommandLine(base::CommandLine* command_line) override {
550 command_line->AppendSwitch(switches::kProcessPerTab); 550 command_line->AppendSwitch(switches::kProcessPerTab);
551 } 551 }
552 552
553 void SetUpOnMainThread() override { 553 void SetUpOnMainThread() override {
554 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 554 ASSERT_TRUE(embedded_test_server()->Start());
555 555
556 // Set up the server and get the test pages. 556 // Set up the server and get the test pages.
557 base::FilePath test_data_dir; 557 base::FilePath test_data_dir;
558 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_data_dir)); 558 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_data_dir));
559 embedded_test_server()->ServeFilesFromDirectory( 559 embedded_test_server()->ServeFilesFromDirectory(
560 test_data_dir.AppendASCII("chrome/test/data/")); 560 test_data_dir.AppendASCII("chrome/test/data/"));
561 audio_url_ = embedded_test_server()->GetURL("/extensions/loop_audio.html"); 561 audio_url_ = embedded_test_server()->GetURL("/extensions/loop_audio.html");
562 no_audio_url_ = embedded_test_server()->GetURL("/title1.html"); 562 no_audio_url_ = embedded_test_server()->GetURL("/title1.html");
563 563
564 // Open a browser, navigate to the audio page and get its WebContents. 564 // Open a browser, navigate to the audio page and get its WebContents.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 content::ExecuteScript(audio_tab_web_contents_, 677 content::ExecuteScript(audio_tab_web_contents_,
678 "document.getElementById('audioPlayer').play();")); 678 "document.getElementById('audioPlayer').play();"));
679 679
680 // Wait until the two pages are not backgrounded. 680 // Wait until the two pages are not backgrounded.
681 while (no_audio_process_.IsProcessBackgrounded() || 681 while (no_audio_process_.IsProcessBackgrounded() ||
682 audio_process_.IsProcessBackgrounded()) { 682 audio_process_.IsProcessBackgrounded()) {
683 base::RunLoop().RunUntilIdle(); 683 base::RunLoop().RunUntilIdle();
684 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout()); 684 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout());
685 } 685 }
686 } 686 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698