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

Side by Side Diff: headless/test/headless_browser_test.cc

Issue 1805983002: headless: Implement client API generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make PendingMessage moveable Created 4 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 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 "headless/test/headless_browser_test.h" 5 #include "headless/test/headless_browser_test.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 bool HeadlessBrowserTest::WaitForLoad(HeadlessWebContents* web_contents) { 92 bool HeadlessBrowserTest::WaitForLoad(HeadlessWebContents* web_contents) {
93 WaitForNavigationObserver observer(this, web_contents); 93 WaitForNavigationObserver observer(this, web_contents);
94 RunAsynchronousTest(); 94 RunAsynchronousTest();
95 return observer.navigation_succeeded(); 95 return observer.navigation_succeeded();
96 } 96 }
97 97
98 void HeadlessBrowserTest::RunAsynchronousTest() { 98 void HeadlessBrowserTest::RunAsynchronousTest() {
99 base::MessageLoop::ScopedNestableTaskAllower nestable_allower( 99 base::MessageLoop::ScopedNestableTaskAllower nestable_allower(
100 base::MessageLoop::current()); 100 base::MessageLoop::current());
101 EXPECT_FALSE(run_loop_);
101 run_loop_ = base::WrapUnique(new base::RunLoop()); 102 run_loop_ = base::WrapUnique(new base::RunLoop());
102 run_loop_->Run(); 103 run_loop_->Run();
103 run_loop_ = nullptr; 104 run_loop_ = nullptr;
104 } 105 }
105 106
106 void HeadlessBrowserTest::FinishAsynchronousTest() { 107 void HeadlessBrowserTest::FinishAsynchronousTest() {
107 run_loop_->Quit(); 108 run_loop_->Quit();
108 } 109 }
109 110
110 } // namespace headless 111 } // namespace headless
OLDNEW
« headless/public/domains/types_unittest.cc ('K') | « headless/public/util/maybe.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698