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