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

Unified Diff: chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc

Issue 2650583012: MacViews: Enable views based Ask Google For Suggestions dialog behind secondary-ui-md flag. (Closed)
Patch Set: Rebase. Created 3 years, 11 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
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc
diff --git a/chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc b/chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6453113e756bca22b41ce43d657ccafa2343e5ae
--- /dev/null
+++ b/chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc
@@ -0,0 +1,47 @@
+// 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 "base/memory/ptr_util.h"
+#include "chrome/browser/renderer_context_menu/spelling_bubble_model.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/confirm_bubble.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/browser/ui/test/test_browser_dialog.h"
+
+class AskGoogleForSuggestionsDialogTest : public DialogBrowserTest {
+ public:
+ AskGoogleForSuggestionsDialogTest() {}
+
+ // DialogBrowserTest:
+ void ShowDialog(const std::string& name) override {
+ std::unique_ptr<SpellingBubbleModel> model =
+ base::MakeUnique<SpellingBubbleModel>(
+ browser()->profile(),
+ browser()->tab_strip_model()->GetActiveWebContents());
+
+ // The toolkit-views version of the dialog does not utilize the anchor_view
+ // and origin parameters passed to this function. Pass dummy values.
+ chrome::ShowConfirmBubble(browser()->window()->GetNativeWindow(), nullptr,
+ gfx::Point(), std::move(model));
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AskGoogleForSuggestionsDialogTest);
+};
+
+#if !defined(OS_MACOSX)
+// Initially disabled except on Mac due to http://crbug.com/683808.
+#define MAYBE_InvokeDialog_default DISABLED_InvokeDialog_default
+#else
+#define MAYBE_InvokeDialog_default InvokeDialog_default
+#endif
+
+// Test that calls ShowDialog("default"). Interactive when run via
+// browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive
+// --dialog=AskGoogleForSuggestionsDialogTest.InvokeDialog_default
+IN_PROC_BROWSER_TEST_F(AskGoogleForSuggestionsDialogTest,
+ MAYBE_InvokeDialog_default) {
+ RunDialog();
+}
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698