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

Unified Diff: chrome/browser/prerender/prerender_resource_handler_unittest.cc

Issue 6171007: For prerendering, keep track of all the intermediate redirects, and hook into... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prerender/prerender_resource_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_resource_handler_unittest.cc
===================================================================
--- chrome/browser/prerender/prerender_resource_handler_unittest.cc (revision 71703)
+++ chrome/browser/prerender/prerender_resource_handler_unittest.cc (working copy)
@@ -100,8 +100,9 @@
pre_handler_->set_get_current_time_function(&FixedGetCurrentTime);
}
- void SetLastHandledURL(const GURL& url) {
+ void SetLastHandledURL(const GURL& url, const std::vector<GURL>& alias_urls) {
last_handled_url_ = url;
+ alias_urls_ = alias_urls;
}
// Common logic shared by many of the tests
@@ -125,6 +126,12 @@
loop_.RunAllPending();
}
+ // Test whether a given URL is part of alias_urls_.
+ bool ContainsAliasURL(const GURL& url) {
+ return std::find(alias_urls_.begin(), alias_urls_.end(), url)
+ != alias_urls_.end();
+ }
+
base::TimeDelta prerender_duration_;
scoped_refptr<MockResourceHandler> mock_handler_;
scoped_refptr<PrerenderResourceHandler> pre_handler_;
@@ -132,6 +139,7 @@
BrowserThread ui_thread_;
GURL last_handled_url_;
GURL default_url_;
+ std::vector<GURL> alias_urls_;
};
namespace {
@@ -208,7 +216,9 @@
EXPECT_TRUE(last_handled_url_.is_empty());
loop_.RunAllPending();
EXPECT_EQ(url_redirect, last_handled_url_);
+ EXPECT_EQ(true, ContainsAliasURL(url_redirect));
+ EXPECT_EQ(true, ContainsAliasURL(default_url_));
+ EXPECT_EQ(2, static_cast<int>(alias_urls_.size()));
}
}
-
« no previous file with comments | « chrome/browser/prerender/prerender_resource_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698