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

Side by Side Diff: content/public/test/content_browser_test_utils.cc

Issue 1905873002: Add content_browsertests for testing cache control flags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove ResourceFetcher change temporarily, fix a nit of #19 Created 4 years, 7 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
« no previous file with comments | « content/public/test/content_browser_test_utils.h ('k') | content/shell/browser/shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/public/test/content_browser_test_utils.h" 5 #include "content/public/test/content_browser_test_utils.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 void ReloadBlockUntilNavigationsComplete(Shell* window, 46 void ReloadBlockUntilNavigationsComplete(Shell* window,
47 int number_of_navigations) { 47 int number_of_navigations) {
48 WaitForLoadStop(window->web_contents()); 48 WaitForLoadStop(window->web_contents());
49 TestNavigationObserver same_tab_observer(window->web_contents(), 49 TestNavigationObserver same_tab_observer(window->web_contents(),
50 number_of_navigations); 50 number_of_navigations);
51 51
52 window->Reload(); 52 window->Reload();
53 same_tab_observer.Wait(); 53 same_tab_observer.Wait();
54 } 54 }
55 55
56 void ReloadBypassingCacheBlockUntilNavigationsComplete(
57 Shell* window,
58 int number_of_navigations) {
59 WaitForLoadStop(window->web_contents());
60 TestNavigationObserver same_tab_observer(window->web_contents(),
61 number_of_navigations);
62
63 window->ReloadBypassingCache();
64 same_tab_observer.Wait();
65 }
66
56 void LoadDataWithBaseURL(Shell* window, 67 void LoadDataWithBaseURL(Shell* window,
57 const GURL& url, 68 const GURL& url,
58 const std::string& data, 69 const std::string& data,
59 const GURL& base_url) { 70 const GURL& base_url) {
60 WaitForLoadStop(window->web_contents()); 71 WaitForLoadStop(window->web_contents());
61 TestNavigationObserver same_tab_observer(window->web_contents(), 1); 72 TestNavigationObserver same_tab_observer(window->web_contents(), 1);
62 73
63 window->LoadDataWithBaseURL(url, data, base_url); 74 window->LoadDataWithBaseURL(url, data, base_url);
64 same_tab_observer.Wait(); 75 same_tab_observer.Wait();
65 } 76 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 122
112 void ShellAddedObserver::ShellCreated(Shell* shell) { 123 void ShellAddedObserver::ShellCreated(Shell* shell) {
113 DCHECK(!shell_); 124 DCHECK(!shell_);
114 shell_ = shell; 125 shell_ = shell;
115 if (runner_.get()) 126 if (runner_.get())
116 runner_->QuitClosure().Run(); 127 runner_->QuitClosure().Run();
117 } 128 }
118 129
119 130
120 } // namespace content 131 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/content_browser_test_utils.h ('k') | content/shell/browser/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698