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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 void BlimpBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { | 86 void BlimpBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { |
87 // Engine switches. | 87 // Engine switches. |
88 blimp::engine::SetCommandLineDefaults(command_line); | 88 blimp::engine::SetCommandLineDefaults(command_line); |
89 | 89 |
90 // Pass through the engine port if it is passed to the test. | 90 // Pass through the engine port if it is passed to the test. |
91 // Otherwise, use a dynamic port. | 91 // Otherwise, use a dynamic port. |
92 if (!command_line->HasSwitch(blimp::engine::kEnginePort)) { | 92 if (!command_line->HasSwitch(blimp::engine::kEnginePort)) { |
93 command_line->AppendSwitchASCII(blimp::engine::kEnginePort, "0"); | 93 command_line->AppendSwitchASCII(blimp::engine::kEnginePort, "0"); |
94 } | 94 } |
95 | 95 |
96 // TODO(perumaal): Switch to gRPC when it's ready. See crbug.com/659279. | |
Wez
2016/11/09 22:47:17
nit: Similarly, this placeholder doesn't really ad
perumaal
2016/11/10 02:05:05
These are more like breadcrumbs for me to track an
| |
97 | |
96 base::FilePath src_root; | 98 base::FilePath src_root; |
97 PathService::Get(base::DIR_SOURCE_ROOT, &src_root); | 99 PathService::Get(base::DIR_SOURCE_ROOT, &src_root); |
98 command_line->AppendSwitchASCII( | 100 command_line->AppendSwitchASCII( |
99 kClientAuthTokenPath, src_root.Append(kClientAuthTokenFilePath).value()); | 101 kClientAuthTokenPath, src_root.Append(kClientAuthTokenFilePath).value()); |
100 } | 102 } |
101 | 103 |
102 void BlimpBrowserTest::SetUpOnMainThread() { | 104 void BlimpBrowserTest::SetUpOnMainThread() { |
103 // Get the connection's port number across the IO/UI thread boundary. | 105 // Get the connection's port number across the IO/UI thread boundary. |
104 GetEngineSession()->GetEnginePortForTesting(base::Bind( | 106 GetEngineSession()->GetEnginePortForTesting(base::Bind( |
105 &BlimpBrowserTest::OnGetEnginePortCompletion, base::Unretained(this))); | 107 &BlimpBrowserTest::OnGetEnginePortCompletion, base::Unretained(this))); |
(...skipping 19 matching lines...) Expand all Loading... | |
125 i.GetCurrentValue()->FastShutdownIfPossible(); | 127 i.GetCurrentValue()->FastShutdownIfPossible(); |
126 } | 128 } |
127 } | 129 } |
128 | 130 |
129 void BlimpBrowserTest::OnGetEnginePortCompletion(uint16_t port) { | 131 void BlimpBrowserTest::OnGetEnginePortCompletion(uint16_t port) { |
130 engine_port_ = port; | 132 engine_port_ = port; |
131 SignalCompletion(); | 133 SignalCompletion(); |
132 } | 134 } |
133 | 135 |
134 } // namespace blimp | 136 } // namespace blimp |
OLD | NEW |