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

Unified Diff: chrome/browser/ui/views/hung_renderer_view_browsertest.cc

Issue 2660553005: Harmony - convert hung renderer dialog. (Closed)
Patch Set: comments 3 Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/hung_renderer_view_browsertest.cc
diff --git a/chrome/browser/ui/views/hung_renderer_view_browsertest.cc b/chrome/browser/ui/views/hung_renderer_view_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d862c48bc8808d6105769b3d32e5f7794f7ef34e
--- /dev/null
+++ b/chrome/browser/ui/views/hung_renderer_view_browsertest.cc
@@ -0,0 +1,37 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <string>
+
+#include "base/command_line.h"
+#include "chrome/browser/platform_util.h"
+#include "chrome/browser/ui/browser.cc"
+#include "chrome/browser/ui/tab_dialogs.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/browser/ui/test/test_browser_dialog.h"
+#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.
+#include "content/public/browser/web_contents_unresponsive_state.h"
+#include "ui/base/ui_base_switches.h"
+
+class HungRendererDialogViewBrowserTest : public DialogBrowserTest {
+ public:
+ HungRendererDialogViewBrowserTest() {}
+
+ // DialogBrowserTest:
+ void ShowDialog(const std::string& name) override {
+ auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents();
+ TabDialogs::FromWebContents(web_contents)
+ ->ShowHungRendererDialog(content::WebContentsUnresponsiveState());
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(HungRendererDialogViewBrowserTest);
+};
+
+// Invokes the hung renderer (aka page unresponsive) dialog. See
+// test_browser_dialog.h.
+IN_PROC_BROWSER_TEST_F(HungRendererDialogViewBrowserTest,
+ InvokeDialog_default) {
+ RunDialog();
+}

Powered by Google App Engine
This is Rietveld 408576698