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 #ifndef BLIMP_ENGINE_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ | 5 #ifndef BLIMP_ENGINE_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ |
6 #define BLIMP_ENGINE_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ | 6 #define BLIMP_ENGINE_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
11 #include "base/threading/thread_restrictions.h" | 11 #include "base/threading/thread_restrictions.h" |
| 12 #include "blimp/common/public/session/assignment_options.h" |
12 #include "content/public/test/browser_test_base.h" | 13 #include "content/public/test/browser_test_base.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class RunLoop; | 16 class RunLoop; |
16 } | 17 } |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 class WebContents; | 20 class WebContents; |
20 } | 21 } |
21 | 22 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // testing::Test implementation. | 59 // testing::Test implementation. |
59 void SetUp() override; | 60 void SetUp() override; |
60 | 61 |
61 // content::BrowserTestBase implementation. | 62 // content::BrowserTestBase implementation. |
62 void RunTestOnMainThreadLoop() override; | 63 void RunTestOnMainThreadLoop() override; |
63 void SetUpCommandLine(base::CommandLine* command_line) override; | 64 void SetUpCommandLine(base::CommandLine* command_line) override; |
64 void SetUpOnMainThread() override; | 65 void SetUpOnMainThread() override; |
65 void TearDownOnMainThread() override; | 66 void TearDownOnMainThread() override; |
66 | 67 |
67 private: | 68 private: |
68 // Receives the port number from an asynchronously connected socket. | 69 // Receives the engine assignment after it completes setup to be passed to |
69 // Calls SignalCompletion() when set. | 70 // the client as is (independent of the specific transport). |
70 void OnGetEnginePortCompletion(uint16_t port); | 71 void OnGetEngineSetupCompletion(AssignmentOptions options); |
71 | 72 |
72 uint16_t engine_port_; | 73 // Engine assignment options filled after the engine is setup. |
| 74 AssignmentOptions assignment_options_; |
73 | 75 |
74 // Used to signal the completion of asynchronous processing to | 76 // Used to signal the completion of asynchronous processing to |
75 // RunUntilCompletion(). | 77 // RunUntilCompletion(). |
76 base::WaitableEvent completion_event_; | 78 base::WaitableEvent completion_event_; |
77 | 79 |
78 // Used to allow UI thread waits. This is useful for integration tests that | 80 // Used to allow UI thread waits. This is useful for integration tests that |
79 // require setting up client components, as testing those sometimes requires | 81 // require setting up client components, as testing those sometimes requires |
80 // setting up GL contexts that might block. | 82 // setting up GL contexts that might block. |
81 std::unique_ptr<base::ThreadRestrictions::ScopedAllowWait> allow_ui_waits_; | 83 std::unique_ptr<base::ThreadRestrictions::ScopedAllowWait> allow_ui_waits_; |
82 | 84 |
83 DISALLOW_COPY_AND_ASSIGN(BlimpBrowserTest); | 85 DISALLOW_COPY_AND_ASSIGN(BlimpBrowserTest); |
84 }; | 86 }; |
85 | 87 |
86 } // namespace blimp | 88 } // namespace blimp |
87 | 89 |
88 #endif // BLIMP_ENGINE_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ | 90 #endif // BLIMP_ENGINE_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_ |
OLD | NEW |