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

Side by Side Diff: chrome/browser/history/history_browsertest.cc

Issue 8050008: gcc 4.6 warnings cleanup (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « base/tools_sanity_unittest.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 5 #include <vector>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "chrome/browser/history/history.h" 8 #include "chrome/browser/history/history.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 { 137 {
138 std::vector<GURL> urls(GetHistoryContents()); 138 std::vector<GURL> urls(GetHistoryContents());
139 ASSERT_EQ(1U, urls.size()); 139 ASSERT_EQ(1U, urls.size());
140 EXPECT_EQ(GetTestUrl().spec(), urls[0].spec()); 140 EXPECT_EQ(GetTestUrl().spec(), urls[0].spec());
141 } 141 }
142 } 142 }
143 143
144 // Test that disabling saving browser history really works. 144 // Test that disabling saving browser history really works.
145 IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, SavingHistoryDisabled) { 145 IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, SavingHistoryDisabled) {
146 base::TimeTicks start_time = base::TimeTicks::Now();
147
148 GetPrefs()->SetBoolean(prefs::kSavingBrowserHistoryDisabled, true); 146 GetPrefs()->SetBoolean(prefs::kSavingBrowserHistoryDisabled, true);
149 147
150 EXPECT_TRUE(GetProfile()->GetHistoryService(Profile::EXPLICIT_ACCESS)); 148 EXPECT_TRUE(GetProfile()->GetHistoryService(Profile::EXPLICIT_ACCESS));
151 EXPECT_FALSE(GetProfile()->GetHistoryService(Profile::IMPLICIT_ACCESS)); 149 EXPECT_FALSE(GetProfile()->GetHistoryService(Profile::IMPLICIT_ACCESS));
152 150
153 ui_test_utils::WaitForHistoryToLoad(browser()); 151 ui_test_utils::WaitForHistoryToLoad(browser());
154 ExpectEmptyHistory(); 152 ExpectEmptyHistory();
155 153
156 ui_test_utils::NavigateToURL(browser(), GetTestUrl()); 154 ui_test_utils::NavigateToURL(browser(), GetTestUrl());
157 WaitForHistoryBackendToRun(); 155 WaitForHistoryBackendToRun();
158 ExpectEmptyHistory(); 156 ExpectEmptyHistory();
159 } 157 }
160 158
161 // Test that changing the pref takes effect immediately 159 // Test that changing the pref takes effect immediately
162 // when the browser is running. 160 // when the browser is running.
163 IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, SavingHistoryEnabledThenDisabled) { 161 IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, SavingHistoryEnabledThenDisabled) {
164 base::TimeTicks start_time = base::TimeTicks::Now();
165
166 EXPECT_FALSE(GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)); 162 EXPECT_FALSE(GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled));
167 163
168 ui_test_utils::WaitForHistoryToLoad(browser()); 164 ui_test_utils::WaitForHistoryToLoad(browser());
169 165
170 ui_test_utils::NavigateToURL(browser(), GetTestUrl()); 166 ui_test_utils::NavigateToURL(browser(), GetTestUrl());
171 WaitForHistoryBackendToRun(); 167 WaitForHistoryBackendToRun();
172 168
173 { 169 {
174 std::vector<GURL> urls(GetHistoryContents()); 170 std::vector<GURL> urls(GetHistoryContents());
175 ASSERT_EQ(1U, urls.size()); 171 ASSERT_EQ(1U, urls.size());
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 WaitForHistoryBackendToRun(); 203 WaitForHistoryBackendToRun();
208 204
209 { 205 {
210 std::vector<GURL> urls(GetHistoryContents()); 206 std::vector<GURL> urls(GetHistoryContents());
211 ASSERT_EQ(1U, urls.size()); 207 ASSERT_EQ(1U, urls.size());
212 EXPECT_EQ(GetTestUrl().spec(), urls[0].spec()); 208 EXPECT_EQ(GetTestUrl().spec(), urls[0].spec());
213 } 209 }
214 } 210 }
215 211
216 } // namespace 212 } // namespace
OLDNEW
« no previous file with comments | « base/tools_sanity_unittest.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698