OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/ui/browser_window.h" | 6 #include "chrome/browser/ui/browser_window.h" |
7 #include "chrome/browser/ui/test/test_browser_dialog.h" | 7 #include "chrome/browser/ui/test/test_browser_dialog.h" |
8 #include "ui/base/ui_base_switches.h" | 8 #include "ui/base/ui_base_switches.h" |
9 | 9 |
10 class UpdateRecommendedDialogTest : public DialogBrowserTest { | 10 class UpdateRecommendedDialogTest : public DialogBrowserTest { |
11 public: | 11 public: |
12 UpdateRecommendedDialogTest() {} | 12 UpdateRecommendedDialogTest() {} |
13 | 13 |
14 // DialogBrowserTest: | 14 // DialogBrowserTest: |
15 void ShowDialog(const std::string& name) override { | 15 void ShowDialog(const std::string& name) override { |
16 InProcessBrowserTest::browser()->window()->ShowUpdateChromeDialog(); | 16 InProcessBrowserTest::browser()->window()->ShowUpdateChromeDialog(); |
17 } | 17 } |
18 | 18 |
19 // content::BrowserTestBase: | 19 // content::BrowserTestBase: |
20 void SetUpCommandLine(base::CommandLine* command_line) override { | 20 void SetUpCommandLine(base::CommandLine* command_line) override { |
21 command_line->AppendSwitch(switches::kExtendMdToSecondaryUi); | 21 command_line->AppendSwitch(switches::kExtendMdToSecondaryUi); |
22 } | 22 } |
23 | 23 |
24 private: | 24 private: |
25 DISALLOW_COPY_AND_ASSIGN(UpdateRecommendedDialogTest); | 25 DISALLOW_COPY_AND_ASSIGN(UpdateRecommendedDialogTest); |
26 }; | 26 }; |
27 | 27 |
28 #if !defined(OS_MACOSX) | |
29 // Initially disabled except on Mac due to http://crbug.com/683808. | |
30 #define MAYBE_InvokeDialog_default DISABLED_InvokeDialog_default | |
31 #else | |
32 #define MAYBE_InvokeDialog_default InvokeDialog_default | |
33 #endif | |
34 | |
35 // Test that calls ShowDialog("default"). Interactive when run via | 28 // Test that calls ShowDialog("default"). Interactive when run via |
36 // browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive | 29 // browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive |
37 // --dialog=UpdateRecommendedDialogTest.InvokeDialog_default | 30 // --dialog=UpdateRecommendedDialogTest.InvokeDialog_default |
38 IN_PROC_BROWSER_TEST_F(UpdateRecommendedDialogTest, | 31 IN_PROC_BROWSER_TEST_F(UpdateRecommendedDialogTest, InvokeDialog_default) { |
39 MAYBE_InvokeDialog_default) { | |
40 RunDialog(); | 32 RunDialog(); |
41 } | 33 } |
OLD | NEW |