Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include <string> | |
| 6 | |
| 7 #include "base/command_line.h" | |
| 8 #include "chrome/browser/platform_util.h" | |
| 9 #include "chrome/browser/ui/browser.cc" | |
| 10 #include "chrome/browser/ui/tab_dialogs.h" | |
| 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | |
| 12 #include "chrome/browser/ui/test/test_browser_dialog.h" | |
| 13 #include "chrome/browser/ui/views/hung_renderer_view.h" | |
|
tapted
2017/02/10 05:37:03
nit: this one should move this all the way to the
Bret
2017/02/11 23:43:15
Done.
| |
| 14 #include "content/public/browser/web_contents_unresponsive_state.h" | |
| 15 #include "ui/base/ui_base_switches.h" | |
| 16 | |
| 17 class HungRendererDialogViewBrowserTest : public DialogBrowserTest { | |
| 18 public: | |
| 19 HungRendererDialogViewBrowserTest() {} | |
| 20 | |
| 21 // DialogBrowserTest: | |
| 22 void ShowDialog(const std::string& name) override { | |
| 23 auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); | |
| 24 TabDialogs::FromWebContents(web_contents) | |
| 25 ->ShowHungRendererDialog(content::WebContentsUnresponsiveState()); | |
| 26 } | |
| 27 | |
| 28 private: | |
| 29 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogViewBrowserTest); | |
| 30 }; | |
| 31 | |
| 32 // Invokes the hung renderer (aka page unresponsive) dialog. See | |
| 33 // test_browser_dialog.h. | |
| 34 IN_PROC_BROWSER_TEST_F(HungRendererDialogViewBrowserTest, | |
| 35 InvokeDialog_default) { | |
| 36 RunDialog(); | |
| 37 } | |
| OLD | NEW |