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

Side by Side Diff: headless/lib/headless_devtools_client_browsertest.cc

Issue 2509813006: HeadlessWebContents:Observer to observe render process exit status (Closed)
Patch Set: Make it safe to call Shutdown() Created 4 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 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 <memory> 5 #include <memory>
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "content/public/browser/render_widget_host_view.h" 8 #include "content/public/browser/render_widget_host_view.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "content/public/common/url_constants.h"
10 #include "content/public/test/browser_test.h" 11 #include "content/public/test/browser_test.h"
11 #include "headless/lib/browser/headless_web_contents_impl.h" 12 #include "headless/lib/browser/headless_web_contents_impl.h"
12 #include "headless/public/devtools/domains/emulation.h" 13 #include "headless/public/devtools/domains/emulation.h"
13 #include "headless/public/devtools/domains/network.h" 14 #include "headless/public/devtools/domains/network.h"
14 #include "headless/public/devtools/domains/page.h" 15 #include "headless/public/devtools/domains/page.h"
15 #include "headless/public/devtools/domains/runtime.h" 16 #include "headless/public/devtools/domains/runtime.h"
16 #include "headless/public/devtools/domains/target.h" 17 #include "headless/public/devtools/domains/target.h"
17 #include "headless/public/headless_browser.h" 18 #include "headless/public/headless_browser.h"
18 #include "headless/public/headless_devtools_client.h" 19 #include "headless/public/headless_devtools_client.h"
19 #include "headless/public/headless_devtools_target.h" 20 #include "headless/public/headless_devtools_target.h"
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 EXPECT_TRUE(navigation_requested_); 654 EXPECT_TRUE(navigation_requested_);
654 FinishAsynchronousTest(); 655 FinishAsynchronousTest();
655 } 656 }
656 657
657 private: 658 private:
658 bool navigation_requested_ = false; 659 bool navigation_requested_ = false;
659 }; 660 };
660 661
661 HEADLESS_ASYNC_DEVTOOLED_TEST_F(HeadlessDevToolsNavigationControlTest); 662 HEADLESS_ASYNC_DEVTOOLED_TEST_F(HeadlessDevToolsNavigationControlTest);
662 663
664 class HeadlessCrashObserverTest : public HeadlessAsyncDevTooledBrowserTest {
665 public:
666 void RunDevTooledTest() override {
667 devtools_client_->GetPage()->Enable();
668 devtools_client_->GetPage()->Navigate(content::kChromeUICrashURL);
669 }
670
671 void RenderProcessExited(base::TerminationStatus status,
672 int exit_code) override {
673 EXPECT_EQ(base::TERMINATION_STATUS_ABNORMAL_TERMINATION, status);
674 FinishAsynchronousTest();
675 render_process_exited_ = true;
676 }
677 };
678
679 HEADLESS_ASYNC_DEVTOOLED_TEST_F(HeadlessCrashObserverTest);
680
663 } // namespace headless 681 } // namespace headless
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698