Chromium Code Reviews| Index: chrome/browser/ui/update_chrome_dialog_browsertest.cc |
| diff --git a/chrome/browser/ui/update_chrome_dialog_browsertest.cc b/chrome/browser/ui/update_chrome_dialog_browsertest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0be313914f493d8434f60731dc983a1d9d61f7e7 |
| --- /dev/null |
| +++ b/chrome/browser/ui/update_chrome_dialog_browsertest.cc |
| @@ -0,0 +1,41 @@ |
| +// 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/command_line.h" |
| +#include "chrome/browser/ui/browser_window.h" |
| +#include "chrome/browser/ui/test/test_browser_dialog.h" |
| +#include "ui/base/ui_base_switches.h" |
| + |
| +#if !defined(OS_MACOSX) |
|
tapted
2017/01/24 04:36:42
nit: move down to line 34 ? (I usually see these l
Greg K
2017/01/24 05:57:16
Done.
|
| +// 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 |
| + |
| +class UpdateRecommendedDialogTest : public DialogBrowserTest { |
| + public: |
| + UpdateRecommendedDialogTest() {} |
| + |
| + // DialogBrowserTesT: |
|
tapted
2017/01/24 04:36:42
nit: DialogBrowserTesT: -> DialogBrowserTest:
Greg K
2017/01/24 05:57:17
Done.
|
| + void ShowDialog(const std::string& name) override { |
| + InProcessBrowserTest::browser()->window()->ShowUpdateChromeDialog(); |
| + } |
| + |
| + // content::BrowserTestBase: |
| + void SetUpCommandLine(base::CommandLine* command_line) override { |
| + command_line->AppendSwitch(switches::kExtendMdToSecondaryUi); |
| + } |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(UpdateRecommendedDialogTest); |
| +}; |
| + |
| +// Test that calls ShowDialog("default"). Interactive when run via |
| +// browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive |
| +// --dialog=UpdateRecommendedDialogTest.InvokeDialog_default |
| +IN_PROC_BROWSER_TEST_F(UpdateRecommendedDialogTest, |
| + MAYBE_InvokeDialog_default) { |
| + RunDialog(); |
| +} |