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

Unified Diff: net/base/sdch_filter_unittest.cc

Issue 100004: Hand craft an A/B test of SDCH compression... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 | « net/base/sdch_filter.cc ('k') | net/base/sdch_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/sdch_filter_unittest.cc
===================================================================
--- net/base/sdch_filter_unittest.cc (revision 14822)
+++ net/base/sdch_filter_unittest.cc (working copy)
@@ -1184,3 +1184,32 @@
EXPECT_FALSE(PathMatch("/ABC", "/abc"));
EXPECT_FALSE(PathMatch("/abc", "/ABC"));
}
+
+// The following are only applicable while we have a latency test in the code,
+// and can be removed when that functionality is stripped.
+TEST_F(SdchFilterTest, LatencyTestControls) {
+ GURL url("http://www.google.com");
+ GURL url2("http://www.google2.com");
+
+ // First make sure we default to false.
+ EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url));
+ EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url2));
+
+ // That we can set each to true.
+ sdch_manager_->SetAllowLatencyExperiment(url, true);
+ EXPECT_TRUE(sdch_manager_->AllowLatencyExperiment(url));
+ EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url2));
+
+ sdch_manager_->SetAllowLatencyExperiment(url2, true);
+ EXPECT_TRUE(sdch_manager_->AllowLatencyExperiment(url));
+ EXPECT_TRUE(sdch_manager_->AllowLatencyExperiment(url2));
+
+ // And can reset them to false.
+ sdch_manager_->SetAllowLatencyExperiment(url, false);
+ EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url));
+ EXPECT_TRUE(sdch_manager_->AllowLatencyExperiment(url2));
+
+ sdch_manager_->SetAllowLatencyExperiment(url2, false);
+ EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url));
+ EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url2));
+}
« no previous file with comments | « net/base/sdch_filter.cc ('k') | net/base/sdch_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698