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

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

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
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 // Navigates the browser to server and client redirect pages and makes sure 5 // Navigates the browser to server and client redirect pages and makes sure
6 // that the correct redirects are reflected in the history database. Errors 6 // that the correct redirects are reflected in the history database. Errors
7 // here might indicate that WebKit changed the calls our glue layer gets in 7 // here might indicate that WebKit changed the calls our glue layer gets in
8 // the case of redirects. It may also mean problems with the history system. 8 // the case of redirects. It may also mean problems with the history system.
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 &tracker_); 57 &tracker_);
58 content::RunMessageLoop(); 58 content::RunMessageLoop();
59 return rv; 59 return rv;
60 } 60 }
61 61
62 protected: 62 protected:
63 void OnRedirectQueryComplete(std::vector<GURL>* rv, 63 void OnRedirectQueryComplete(std::vector<GURL>* rv,
64 const history::RedirectList* redirects) { 64 const history::RedirectList* redirects) {
65 rv->insert(rv->end(), redirects->begin(), redirects->end()); 65 rv->insert(rv->end(), redirects->begin(), redirects->end());
66 base::ThreadTaskRunnerHandle::Get()->PostTask( 66 base::ThreadTaskRunnerHandle::Get()->PostTask(
67 FROM_HERE, base::MessageLoop::QuitClosure()); 67 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
68 } 68 }
69 69
70 // Tracker for asynchronous history queries. 70 // Tracker for asynchronous history queries.
71 base::CancelableTaskTracker tracker_; 71 base::CancelableTaskTracker tracker_;
72 }; 72 };
73 73
74 // Tests a single server redirect 74 // Tests a single server redirect
75 IN_PROC_BROWSER_TEST_F(RedirectTest, Server) { 75 IN_PROC_BROWSER_TEST_F(RedirectTest, Server) {
76 ASSERT_TRUE(test_server()->Start()); 76 ASSERT_TRUE(test_server()->Start());
77 GURL final_url = test_server()->GetURL(std::string()); 77 GURL final_url = test_server()->GetURL(std::string());
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // as a client redirect from the first (/client-redirect?) page. 301 // as a client redirect from the first (/client-redirect?) page.
302 for (std::vector<GURL>::iterator it = redirects.begin(); 302 for (std::vector<GURL>::iterator it = redirects.begin();
303 it != redirects.end(); ++it) { 303 it != redirects.end(); ++it) {
304 if (final_url.spec() == it->spec()) { 304 if (final_url.spec() == it->spec()) {
305 final_navigation_not_redirect = false; 305 final_navigation_not_redirect = false;
306 break; 306 break;
307 } 307 }
308 } 308 }
309 EXPECT_TRUE(final_navigation_not_redirect); 309 EXPECT_TRUE(final_navigation_not_redirect);
310 } 310 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_browsertest.cc ('k') | chrome/browser/importer/firefox_importer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698