OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/engine/browser_tests/blimp_browser_test.h" | 5 #include "blimp/engine/browser_tests/blimp_browser_test.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return assignment; | 69 return assignment; |
70 } | 70 } |
71 | 71 |
72 void BlimpBrowserTest::SetUpOnMainThread() { | 72 void BlimpBrowserTest::SetUpOnMainThread() { |
73 GetEngineSession()->GetEnginePortForTesting( | 73 GetEngineSession()->GetEnginePortForTesting( |
74 base::Bind(&BlimpBrowserTest::OnGetEnginePort, base::Unretained(this))); | 74 base::Bind(&BlimpBrowserTest::OnGetEnginePort, base::Unretained(this))); |
75 RunUntilQuit(); | 75 RunUntilQuit(); |
76 } | 76 } |
77 | 77 |
78 void BlimpBrowserTest::TearDownOnMainThread() { | 78 void BlimpBrowserTest::TearDownOnMainThread() { |
79 content::BrowserThread::GetMessageLoopProxyForThread( | 79 content::BrowserThread::GetTaskRunnerForThread(content::BrowserThread::UI) |
80 content::BrowserThread::UI) | |
81 ->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); | 80 ->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
82 } | 81 } |
83 | 82 |
84 void BlimpBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { | 83 void BlimpBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { |
85 // Engine switches. | 84 // Engine switches. |
86 blimp::engine::SetCommandLineDefaults(command_line); | 85 blimp::engine::SetCommandLineDefaults(command_line); |
87 | 86 |
88 // Pass through the engine port if it is passed to the test. | 87 // Pass through the engine port if it is passed to the test. |
89 // Otherwise, use a dynamic port. | 88 // Otherwise, use a dynamic port. |
90 if (!command_line->HasSwitch(blimp::engine::kEnginePort)) { | 89 if (!command_line->HasSwitch(blimp::engine::kEnginePort)) { |
(...skipping 30 matching lines...) Expand all Loading... |
121 run_loop_ = base::WrapUnique(new base::RunLoop()); | 120 run_loop_ = base::WrapUnique(new base::RunLoop()); |
122 run_loop_->Run(); | 121 run_loop_->Run(); |
123 run_loop_ = nullptr; | 122 run_loop_ = nullptr; |
124 } | 123 } |
125 | 124 |
126 void BlimpBrowserTest::QuitRunLoop() { | 125 void BlimpBrowserTest::QuitRunLoop() { |
127 run_loop_->Quit(); | 126 run_loop_->Quit(); |
128 } | 127 } |
129 | 128 |
130 } // namespace blimp | 129 } // namespace blimp |
OLD | NEW |