Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
tapted
2017/02/01 00:52:48
nit: 2017
Bret
2017/02/01 02:21:46
Done.
| |
| 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" | |
| 14 #include "content/public/browser/web_contents_unresponsive_state.h" | |
| 15 #include "ui/base/ui_base_switches.h" | |
| 16 | |
| 17 // TODO(crbug.com/687387): If the dialog is invisible when invoked interactively | |
| 18 // pass --disable-gpu as a workaround. | |
| 19 class HungRendererDialogViewBrowserTest : public DialogBrowserTest { | |
| 20 public: | |
| 21 HungRendererDialogViewBrowserTest() {} | |
| 22 | |
| 23 // TestDialogInterface: | |
|
tapted
2017/02/01 00:52:48
// DialogBrowserTest:
(sorry - I'll update that d
Bret
2017/02/01 02:21:46
Done. I took it from the collected cookies version
| |
| 24 void ShowDialog(const std::string& name) override { | |
| 25 content::WebContents* web_contents = | |
| 26 browser()->tab_strip_model()->GetActiveWebContents(); | |
| 27 TabDialogs::FromWebContents(web_contents) | |
| 28 ->ShowHungRendererDialog(content::WebContentsUnresponsiveState()); | |
| 29 } | |
| 30 | |
| 31 views::Widget* widget_; | |
|
tapted
2017/02/01 00:52:48
unused?
Bret
2017/02/01 02:21:46
Oops yeah. Removed.
| |
| 32 | |
| 33 private: | |
| 34 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogViewBrowserTest); | |
| 35 }; | |
| 36 | |
| 37 class HungRendererDialogViewBrowserTestMd | |
| 38 : public HungRendererDialogViewBrowserTest { | |
| 39 public: | |
| 40 HungRendererDialogViewBrowserTestMd() {} | |
| 41 | |
| 42 // content::BrowserTestBase: | |
| 43 void SetUpCommandLine(base::CommandLine* command_line) override { | |
|
tapted
2017/02/01 00:52:48
I think this can be merged into the above test har
Bret
2017/02/01 02:21:46
Done.
| |
| 44 command_line->AppendSwitch(switches::kExtendMdToSecondaryUi); | |
| 45 } | |
| 46 | |
| 47 private: | |
| 48 DISALLOW_COPY_AND_ASSIGN(HungRendererDialogViewBrowserTestMd); | |
| 49 }; | |
| 50 | |
| 51 IN_PROC_BROWSER_TEST_F(HungRendererDialogViewBrowserTestMd, | |
|
tapted
2017/02/01 00:52:48
nit: add a comment (I try to ensure every TEST_F h
Bret
2017/02/01 02:21:46
I don't like the idea of baking the invocation int
| |
| 52 InvokeDialog_default) { | |
| 53 RunDialog(); | |
| 54 } | |
| OLD | NEW |