Chromium Code Reviews| Index: chrome/browser/ui/update_chrome_dialog_browsertest.mm |
| diff --git a/chrome/browser/ui/update_chrome_dialog_browsertest.mm b/chrome/browser/ui/update_chrome_dialog_browsertest.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..94b803afcda438b46dfff3d4fa08e7e903139b4b |
| --- /dev/null |
| +++ b/chrome/browser/ui/update_chrome_dialog_browsertest.mm |
| @@ -0,0 +1,40 @@ |
| +// 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_dialogs.h" |
| +#include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| +#include "chrome/browser/ui/test/test_browser_dialog.h" |
| +#include "ui/base/ui_base_switches.h" |
| + |
| +class UpdateRecommendedDialogTest : public DialogBrowserTest { |
| + public: |
| + UpdateRecommendedDialogTest() {} |
| + |
| + // TestDialogInterface: |
| + void ShowDialog(const std::string& name) override { |
| + InProcessBrowserTest::browser()->window()->ShowUpdateChromeDialog(); |
| + } |
| +}; |
|
tapted
2017/01/24 00:28:11
nit: private:
DISALLOW_..
Greg K
2017/01/24 00:46:49
Done.
|
| + |
| +// Runs with --secondary-ui-md. |
| +class UpdateRecommendedDialogTestMd : public UpdateRecommendedDialogTest { |
| + public: |
| + UpdateRecommendedDialogTestMd() {} |
| + |
| + // content::BrowserTestBase: |
| + void SetUpCommandLine(base::CommandLine* command_line) override { |
|
tapted
2017/01/24 00:28:11
I think we can just collapse this into the test ab
Greg K
2017/01/24 00:46:49
Done.
|
| + command_line->AppendSwitch(switches::kExtendMdToSecondaryUi); |
| + } |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(UpdateRecommendedDialogTestMd); |
| +}; |
| + |
| +// Test that calls ShowDialog("default"). Interactive when run via |
| +// browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive |
| +// --dialog=UpdateRecommendedDialogTestMd.InvokeDialog_default |
| +IN_PROC_BROWSER_TEST_F(UpdateRecommendedDialogTestMd, InvokeDialog_default) { |
| + RunDialog(); |
| +} |