Chromium Code Reviews| 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..bb574885e0f5f777133eba06b0d50dbdb89cdf28 |
| --- /dev/null |
| +++ b/chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc |
| @@ -0,0 +1,44 @@ |
| +// 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 "chrome/browser/renderer_context_menu/spelling_bubble_model.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(DialogParent(), 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. |
|
karandeepb
2017/01/25 11:08:28
This seems to be failing on Linux and windows on t
tapted
2017/01/27 02:09:50
We can try depending on the fix(es) for crbug.com/
tapted
2017/01/31 23:52:39
The fix for this has landed in r447216, so it shou
karandeepb
2017/02/01 00:01:18
Will submit a patch.
|
| +#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(); |
| +} |