| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 2960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2971 provider_.UpdateChromePolicy(policies); | 2971 provider_.UpdateChromePolicy(policies); |
| 2972 // This should restore the tabs opened at PRE_RunTest below. | 2972 // This should restore the tabs opened at PRE_RunTest below. |
| 2973 for (size_t i = 0; i < arraysize(kRestoredURLs); ++i) | 2973 for (size_t i = 0; i < arraysize(kRestoredURLs); ++i) |
| 2974 expected_urls_.push_back(GURL(kRestoredURLs[i])); | 2974 expected_urls_.push_back(GURL(kRestoredURLs[i])); |
| 2975 } | 2975 } |
| 2976 | 2976 |
| 2977 std::vector<GURL> expected_urls_; | 2977 std::vector<GURL> expected_urls_; |
| 2978 }; | 2978 }; |
| 2979 | 2979 |
| 2980 IN_PROC_BROWSER_TEST_P(RestoreOnStartupPolicyTest, PRE_RunTest) { | 2980 IN_PROC_BROWSER_TEST_P(RestoreOnStartupPolicyTest, PRE_RunTest) { |
| 2981 // Do not show Welcome Page. |
| 2982 browser()->profile()->GetPrefs()->SetBoolean(prefs::kHasSeenWelcomePage, |
| 2983 true); |
| 2984 |
| 2985 #if defined(OS_WIN) |
| 2986 // Do not show the Windows 10 promo page. |
| 2987 g_browser_process->local_state()->SetBoolean(prefs::kHasSeenWin10PromoPage, |
| 2988 true); |
| 2989 #endif |
| 2990 |
| 2981 // Open some tabs to verify if they are restored after the browser restarts. | 2991 // Open some tabs to verify if they are restored after the browser restarts. |
| 2982 // Most policy settings override this, except kPrefValueLast which enforces | 2992 // Most policy settings override this, except kPrefValueLast which enforces |
| 2983 // a restore. | 2993 // a restore. |
| 2984 ui_test_utils::NavigateToURL(browser(), GURL(kRestoredURLs[0])); | 2994 ui_test_utils::NavigateToURL(browser(), GURL(kRestoredURLs[0])); |
| 2985 for (size_t i = 1; i < arraysize(kRestoredURLs); ++i) { | 2995 for (size_t i = 1; i < arraysize(kRestoredURLs); ++i) { |
| 2986 content::WindowedNotificationObserver observer( | 2996 content::WindowedNotificationObserver observer( |
| 2987 content::NOTIFICATION_LOAD_STOP, | 2997 content::NOTIFICATION_LOAD_STOP, |
| 2988 content::NotificationService::AllSources()); | 2998 content::NotificationService::AllSources()); |
| 2989 chrome::AddSelectedTabWithURL(browser(), GURL(kRestoredURLs[i]), | 2999 chrome::AddSelectedTabWithURL(browser(), GURL(kRestoredURLs[i]), |
| 2990 ui::PAGE_TRANSITION_LINK); | 3000 ui::PAGE_TRANSITION_LINK); |
| (...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4321 | 4331 |
| 4322 SetEmptyPolicy(); | 4332 SetEmptyPolicy(); |
| 4323 // Policy not set. | 4333 // Policy not set. |
| 4324 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4334 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4325 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4335 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4326 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4336 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4327 } | 4337 } |
| 4328 #endif // defined(OS_CHROMEOS) | 4338 #endif // defined(OS_CHROMEOS) |
| 4329 | 4339 |
| 4330 } // namespace policy | 4340 } // namespace policy |
| OLD | NEW |