| 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 "chrome/browser/ui/views/hung_renderer_view.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "base/command_line.h" |
| 10 #include "chrome/browser/platform_util.h" |
| 11 #include "chrome/browser/ui/browser.cc" |
| 12 #include "chrome/browser/ui/tab_dialogs.h" |
| 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 14 #include "chrome/browser/ui/test/test_browser_dialog.h" |
| 15 #include "content/public/browser/web_contents_unresponsive_state.h" |
| 16 #include "ui/base/ui_base_switches.h" |
| 17 |
| 18 class HungRendererDialogViewBrowserTest : public DialogBrowserTest { |
| 19 public: |
| 20 HungRendererDialogViewBrowserTest() {} |
| 21 |
| 22 // DialogBrowserTest: |
| 23 void ShowDialog(const std::string& name) override { |
| 24 auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); |
| 25 TabDialogs::FromWebContents(web_contents) |
| 26 ->ShowHungRendererDialog(content::WebContentsUnresponsiveState()); |
| 27 } |
| 28 |
| 29 private: |
| 30 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogViewBrowserTest); |
| 31 }; |
| 32 |
| 33 // TODO(tapted): On OSX the framework doesn't pick up the spawned dialog, and |
| 34 // the ASSERT_EQ in TestBrowserDialog::RunDialog() fails, so disabled for now. |
| 35 #if defined(OS_MACOSX) |
| 36 #define MAYBE_InvokeDialog_default DISABLED_InvokeDialog_default |
| 37 #else |
| 38 #define MAYBE_InvokeDialog_default InvokeDialog_default |
| 39 #endif |
| 40 // Invokes the hung renderer (aka page unresponsive) dialog. See |
| 41 // test_browser_dialog.h. |
| 42 IN_PROC_BROWSER_TEST_F(HungRendererDialogViewBrowserTest, |
| 43 MAYBE_InvokeDialog_default) { |
| 44 RunDialog(); |
| 45 } |
| OLD | NEW |