| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/prefs/session_startup_pref.h" | 5 #include "chrome/browser/prefs/session_startup_pref.h" |
| 6 #include "chrome/common/pref_names.h" | 6 #include "chrome/common/pref_names.h" |
| 7 #include "chrome/test/testing_pref_service.h" | 7 #include "chrome/test/testing_pref_service.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 url_pref_list2->Set(1, Value::CreateStringValue("chromium.org")); | 42 url_pref_list2->Set(1, Value::CreateStringValue("chromium.org")); |
| 43 url_pref_list2->Set(2, Value::CreateStringValue("chromium.org")); | 43 url_pref_list2->Set(2, Value::CreateStringValue("chromium.org")); |
| 44 pref_service_->SetManagedPref(prefs::kURLsToRestoreOnStartup, | 44 pref_service_->SetManagedPref(prefs::kURLsToRestoreOnStartup, |
| 45 url_pref_list2); | 45 url_pref_list2); |
| 46 | 46 |
| 47 SessionStartupPref result = | 47 SessionStartupPref result = |
| 48 SessionStartupPref::GetStartupPref(pref_service_.get()); | 48 SessionStartupPref::GetStartupPref(pref_service_.get()); |
| 49 EXPECT_EQ(3u, result.urls.size()); | 49 EXPECT_EQ(3u, result.urls.size()); |
| 50 | 50 |
| 51 SessionStartupPref override_test = | 51 SessionStartupPref override_test = |
| 52 SessionStartupPref::SessionStartupPref(SessionStartupPref::URLS); | 52 SessionStartupPref(SessionStartupPref::URLS); |
| 53 override_test.urls.push_back(GURL("dev.chromium.org")); | 53 override_test.urls.push_back(GURL("dev.chromium.org")); |
| 54 SessionStartupPref::SetStartupPref(pref_service_.get(), override_test); | 54 SessionStartupPref::SetStartupPref(pref_service_.get(), override_test); |
| 55 | 55 |
| 56 result = SessionStartupPref::GetStartupPref(pref_service_.get()); | 56 result = SessionStartupPref::GetStartupPref(pref_service_.get()); |
| 57 EXPECT_EQ(3u, result.urls.size()); | 57 EXPECT_EQ(3u, result.urls.size()); |
| 58 } | 58 } |
| OLD | NEW |