| 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 "base/memory/ptr_util.h" |
| 6 #include "chrome/browser/renderer_context_menu/spelling_bubble_model.h" |
| 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/browser_window.h" |
| 9 #include "chrome/browser/ui/confirm_bubble.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 11 #include "chrome/browser/ui/test/test_browser_dialog.h" |
| 12 |
| 13 class AskGoogleForSuggestionsDialogTest : public DialogBrowserTest { |
| 14 public: |
| 15 AskGoogleForSuggestionsDialogTest() {} |
| 16 |
| 17 // DialogBrowserTest: |
| 18 void ShowDialog(const std::string& name) override { |
| 19 std::unique_ptr<SpellingBubbleModel> model = |
| 20 base::MakeUnique<SpellingBubbleModel>( |
| 21 browser()->profile(), |
| 22 browser()->tab_strip_model()->GetActiveWebContents()); |
| 23 |
| 24 // The toolkit-views version of the dialog does not utilize the anchor_view |
| 25 // and origin parameters passed to this function. Pass dummy values. |
| 26 chrome::ShowConfirmBubble(browser()->window()->GetNativeWindow(), nullptr, |
| 27 gfx::Point(), std::move(model)); |
| 28 } |
| 29 |
| 30 private: |
| 31 DISALLOW_COPY_AND_ASSIGN(AskGoogleForSuggestionsDialogTest); |
| 32 }; |
| 33 |
| 34 #if !defined(OS_MACOSX) |
| 35 // Initially disabled except on Mac due to http://crbug.com/683808. |
| 36 #define MAYBE_InvokeDialog_default DISABLED_InvokeDialog_default |
| 37 #else |
| 38 #define MAYBE_InvokeDialog_default InvokeDialog_default |
| 39 #endif |
| 40 |
| 41 // Test that calls ShowDialog("default"). Interactive when run via |
| 42 // browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive |
| 43 // --dialog=AskGoogleForSuggestionsDialogTest.InvokeDialog_default |
| 44 IN_PROC_BROWSER_TEST_F(AskGoogleForSuggestionsDialogTest, |
| 45 MAYBE_InvokeDialog_default) { |
| 46 RunDialog(); |
| 47 } |
| OLD | NEW |