OLD | NEW |
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 <limits.h> | 5 #include <limits.h> |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1339 | 1339 |
1340 // Rely on the slash at the end of the restriction. | 1340 // Rely on the slash at the end of the restriction. |
1341 EXPECT_TRUE(PathMatch("/search/something", "/search/")); | 1341 EXPECT_TRUE(PathMatch("/search/something", "/search/")); |
1342 EXPECT_TRUE(PathMatch("/search/s", "/search/")); | 1342 EXPECT_TRUE(PathMatch("/search/s", "/search/")); |
1343 EXPECT_TRUE(PathMatch("/search/other", "/search/")); | 1343 EXPECT_TRUE(PathMatch("/search/other", "/search/")); |
1344 EXPECT_TRUE(PathMatch("/search/something", "/search/")); | 1344 EXPECT_TRUE(PathMatch("/search/something", "/search/")); |
1345 | 1345 |
1346 // Make sure less that sufficient prefix match is false. | 1346 // Make sure less that sufficient prefix match is false. |
1347 EXPECT_FALSE(PathMatch("/sear", "/search")); | 1347 EXPECT_FALSE(PathMatch("/sear", "/search")); |
1348 EXPECT_FALSE(PathMatch("/", "/search")); | 1348 EXPECT_FALSE(PathMatch("/", "/search")); |
1349 EXPECT_FALSE(PathMatch("", "/search")); | 1349 EXPECT_FALSE(PathMatch(std::string(), "/search")); |
1350 | 1350 |
1351 // Add examples with several levels of direcories in the restriction. | 1351 // Add examples with several levels of direcories in the restriction. |
1352 EXPECT_FALSE(PathMatch("/search/something", "search/s")); | 1352 EXPECT_FALSE(PathMatch("/search/something", "search/s")); |
1353 EXPECT_FALSE(PathMatch("/search/", "/search/s")); | 1353 EXPECT_FALSE(PathMatch("/search/", "/search/s")); |
1354 | 1354 |
1355 // Make sure adding characters to path will also fail. | 1355 // Make sure adding characters to path will also fail. |
1356 EXPECT_FALSE(PathMatch("/searching", "/search/")); | 1356 EXPECT_FALSE(PathMatch("/searching", "/search/")); |
1357 EXPECT_FALSE(PathMatch("/searching", "/search")); | 1357 EXPECT_FALSE(PathMatch("/searching", "/search")); |
1358 | 1358 |
1359 // Make sure we're case sensitive. | 1359 // Make sure we're case sensitive. |
(...skipping 24 matching lines...) Expand all Loading... |
1384 sdch_manager_->SetAllowLatencyExperiment(url, false); | 1384 sdch_manager_->SetAllowLatencyExperiment(url, false); |
1385 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); | 1385 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); |
1386 EXPECT_TRUE(sdch_manager_->AllowLatencyExperiment(url2)); | 1386 EXPECT_TRUE(sdch_manager_->AllowLatencyExperiment(url2)); |
1387 | 1387 |
1388 sdch_manager_->SetAllowLatencyExperiment(url2, false); | 1388 sdch_manager_->SetAllowLatencyExperiment(url2, false); |
1389 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); | 1389 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); |
1390 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url2)); | 1390 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url2)); |
1391 } | 1391 } |
1392 | 1392 |
1393 } // namespace net | 1393 } // namespace net |
OLD | NEW |