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

Side by Side Diff: chrome/browser/browsing_data/conditional_cache_deletion_helper_browsertest.cc

Issue 2485253002: Remove unnecessary calls to GURL() (Closed)
Patch Set: Assert that StringPiece must always be canonicalized. Fix some constants. Created 4 years, 1 month 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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 <algorithm> 5 #include <algorithm>
6 #include <memory> 6 #include <memory>
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 17 matching lines...) Expand all
28 28
29 namespace { 29 namespace {
30 30
31 bool KeyIsEven(const disk_cache::Entry* entry) { 31 bool KeyIsEven(const disk_cache::Entry* entry) {
32 int key_as_int = 0; 32 int key_as_int = 0;
33 base::StringToInt(entry->GetKey().c_str(), &key_as_int); 33 base::StringToInt(entry->GetKey().c_str(), &key_as_int);
34 return (key_as_int % 2) == 0; 34 return (key_as_int % 2) == 0;
35 } 35 }
36 36
37 bool HasHttpsExampleOrigin(const GURL& url) { 37 bool HasHttpsExampleOrigin(const GURL& url) {
38 return url.GetOrigin() == GURL("https://example.com"); 38 return url.GetOrigin() == "https://example.com/";
39 } 39 }
40 40
41 } // namespace 41 } // namespace
42 42
43 class ConditionalCacheDeletionHelperBrowserTest : public InProcessBrowserTest { 43 class ConditionalCacheDeletionHelperBrowserTest : public InProcessBrowserTest {
44 public: 44 public:
45 // Initialization ------------------------------------------------------------ 45 // Initialization ------------------------------------------------------------
46 46
47 void SetUpOnMainThread() override { 47 void SetUpOnMainThread() override {
48 // Prepare the commonly used callbacks. 48 // Prepare the commonly used callbacks.
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 BrowserThread::IO, FROM_HERE, 308 BrowserThread::IO, FROM_HERE,
309 base::Bind(&ConditionalCacheDeletionHelperBrowserTest::GetRemainingKeys, 309 base::Bind(&ConditionalCacheDeletionHelperBrowserTest::GetRemainingKeys,
310 base::Unretained(this))); 310 base::Unretained(this)));
311 WaitForTasksOnIOThread(); 311 WaitForTasksOnIOThread();
312 312
313 keys.insert(newer_keys.begin(), newer_keys.end()); 313 keys.insert(newer_keys.begin(), newer_keys.end());
314 keys.erase("https://example.com/foo/bar/icon2.png"); 314 keys.erase("https://example.com/foo/bar/icon2.png");
315 keys.erase("https://example.com/foo/bar/icon3.png"); 315 keys.erase("https://example.com/foo/bar/icon3.png");
316 CompareRemainingKeys(keys); 316 CompareRemainingKeys(keys);
317 } 317 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_about_handler.cc ('k') | chrome/browser/captive_portal/captive_portal_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698