| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/prefs/session_startup_pref.h" | 8 #include "chrome/browser/prefs/session_startup_pref.h" |
| 9 #include "chrome/browser/protector/base_setting_change.h" | 9 #include "chrome/browser/protector/base_setting_change.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 scoped_ptr<BaseSettingChange> change( | 97 scoped_ptr<BaseSettingChange> change( |
| 98 CreateSessionStartupChange(initial_startup_pref_, empty_pinned_tabs_, | 98 CreateSessionStartupChange(initial_startup_pref_, empty_pinned_tabs_, |
| 99 backup_startup_pref, empty_pinned_tabs_)); | 99 backup_startup_pref, empty_pinned_tabs_)); |
| 100 ASSERT_TRUE(change->Init(&profile_)); | 100 ASSERT_TRUE(change->Init(&profile_)); |
| 101 EXPECT_EQ(open_ntp_caption, change->GetApplyButtonText()); | 101 EXPECT_EQ(open_ntp_caption, change->GetApplyButtonText()); |
| 102 EXPECT_EQ(GURL(), change->GetNewSettingURL()); | 102 EXPECT_EQ(GURL(), change->GetNewSettingURL()); |
| 103 EXPECT_EQ(kNoDisplayName, change->GetApplyDisplayName()); | 103 EXPECT_EQ(kNoDisplayName, change->GetApplyDisplayName()); |
| 104 | 104 |
| 105 // Pinned tabs count as startup URLs as well. | 105 // Pinned tabs count as startup URLs as well. |
| 106 PinnedTabCodec::Tabs new_pinned_tabs; | 106 PinnedTabCodec::Tabs new_pinned_tabs; |
| 107 BrowserInit::LaunchWithProfile::Tab pinned_tab; | 107 StartupBrowserCreator::LaunchWithProfile::Tab pinned_tab; |
| 108 pinned_tab.url = GURL(kStartupUrl3); | 108 pinned_tab.url = GURL(kStartupUrl3); |
| 109 new_pinned_tabs.push_back(pinned_tab); | 109 new_pinned_tabs.push_back(pinned_tab); |
| 110 change.reset( | 110 change.reset( |
| 111 CreateSessionStartupChange(initial_startup_pref_, new_pinned_tabs, | 111 CreateSessionStartupChange(initial_startup_pref_, new_pinned_tabs, |
| 112 backup_startup_pref, empty_pinned_tabs_)); | 112 backup_startup_pref, empty_pinned_tabs_)); |
| 113 ASSERT_TRUE(change->Init(&profile_)); | 113 ASSERT_TRUE(change->Init(&profile_)); |
| 114 EXPECT_EQ(open_url3_etc_caption, change->GetApplyButtonText()); | 114 EXPECT_EQ(open_url3_etc_caption, change->GetApplyButtonText()); |
| 115 EXPECT_EQ(GURL(kStartupUrl3), change->GetNewSettingURL()); | 115 EXPECT_EQ(GURL(kStartupUrl3), change->GetNewSettingURL()); |
| 116 EXPECT_EQ(UTF8ToUTF16(kStartupHost3), change->GetApplyDisplayName().second); | 116 EXPECT_EQ(UTF8ToUTF16(kStartupHost3), change->GetApplyDisplayName().second); |
| 117 | 117 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 change.reset( | 181 change.reset( |
| 182 CreateSessionStartupChange(initial_startup_pref_, new_pinned_tabs, | 182 CreateSessionStartupChange(initial_startup_pref_, new_pinned_tabs, |
| 183 backup_startup_pref, empty_pinned_tabs_)); | 183 backup_startup_pref, empty_pinned_tabs_)); |
| 184 ASSERT_TRUE(change->Init(&profile_)); | 184 ASSERT_TRUE(change->Init(&profile_)); |
| 185 EXPECT_EQ(open_url3_etc_caption, change->GetApplyButtonText()); | 185 EXPECT_EQ(open_url3_etc_caption, change->GetApplyButtonText()); |
| 186 EXPECT_EQ(GURL(kStartupUrl3), change->GetNewSettingURL()); | 186 EXPECT_EQ(GURL(kStartupUrl3), change->GetNewSettingURL()); |
| 187 EXPECT_EQ(UTF8ToUTF16(kStartupHost3), change->GetApplyDisplayName().second); | 187 EXPECT_EQ(UTF8ToUTF16(kStartupHost3), change->GetApplyDisplayName().second); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace protector | 190 } // namespace protector |
| OLD | NEW |