Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: chrome/browser/ui/webui/set_as_default_browser_ui_browsertest_win.cc

Issue 2909943003: Removing useless Win7 checks + standardize its use (Closed)
Patch Set: Fix reversed conditionnal Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/ui/webui/set_as_default_browser_ui_win.h" 5 #include "chrome/browser/ui/webui/set_as_default_browser_ui_win.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/win/windows_version.h" 8 #include "base/win/windows_version.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 protected: 35 protected:
36 void TearDownInProcessBrowserTestFixture() override { 36 void TearDownInProcessBrowserTestFixture() override {
37 ASSERT_FALSE(SetAsDefaultBrowserUI::GetDialogWidgetForTesting()); 37 ASSERT_FALSE(SetAsDefaultBrowserUI::GetDialogWidgetForTesting());
38 } 38 }
39 }; 39 };
40 40
41 IN_PROC_BROWSER_TEST_F(SetAsDefaultBrowserUIBrowserTestWithFirstRun, Test) { 41 IN_PROC_BROWSER_TEST_F(SetAsDefaultBrowserUIBrowserTestWithFirstRun, Test) {
42 // Windows 8 only test case. 42 // Windows 8 only test case.
43 if (base::win::GetVersion() <= base::win::VERSION_WIN7 || 43 if (base::win::GetVersion() != base::win::VERSION_WIN8 &&
44 base::win::GetVersion() >= base::win::VERSION_WIN10) { 44 base::win::GetVersion() != base::win::VERSION_WIN8_1) {
Nico 2017/06/01 15:01:22 nit: To me, the prior `if (base::win::GetVersion()
Patrick Monette 2017/06/02 00:34:04 Acknowledged. I think I still prefer it this way s
45 return; 45 return;
46 } 46 }
47 ASSERT_FALSE(IsBrowserVisible(browser())); 47 ASSERT_FALSE(IsBrowserVisible(browser()));
48 views::Widget* dialog_widget = 48 views::Widget* dialog_widget =
49 SetAsDefaultBrowserUI::GetDialogWidgetForTesting(); 49 SetAsDefaultBrowserUI::GetDialogWidgetForTesting();
50 ASSERT_TRUE(dialog_widget); 50 ASSERT_TRUE(dialog_widget);
51 ASSERT_TRUE(dialog_widget->IsVisible()); 51 ASSERT_TRUE(dialog_widget->IsVisible());
52 dialog_widget->CloseNow(); 52 dialog_widget->CloseNow();
53 ASSERT_TRUE(IsBrowserVisible(browser())); 53 ASSERT_TRUE(IsBrowserVisible(browser()));
54 } 54 }
55 55
56 IN_PROC_BROWSER_TEST_F(SetAsDefaultBrowserUIBrowserTestWithoutFirstRun, 56 IN_PROC_BROWSER_TEST_F(SetAsDefaultBrowserUIBrowserTestWithoutFirstRun,
57 TestWithoutFirstRun) { 57 TestWithoutFirstRun) {
58 ASSERT_TRUE(IsBrowserVisible(browser())); 58 ASSERT_TRUE(IsBrowserVisible(browser()));
59 EXPECT_EQ(nullptr, SetAsDefaultBrowserUI::GetDialogWidgetForTesting()); 59 EXPECT_EQ(nullptr, SetAsDefaultBrowserUI::GetDialogWidgetForTesting());
60 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698