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

Side by Side Diff: chrome/browser/errorpage_browsertest.cc

Issue 207553008: Surface button for loading stale cache copy on net error page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Shift text to match behavior doc. Created 6 years, 9 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 | Annotate | Revision Log
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 void GoForwardAndWaitForNavigations(int num_navigations) { 247 void GoForwardAndWaitForNavigations(int num_navigations) {
248 NavigateHistory(num_navigations, HISTORY_NAVIGATE_FORWARD); 248 NavigateHistory(num_navigations, HISTORY_NAVIGATE_FORWARD);
249 } 249 }
250 250
251 // Confirms that the javascript variable indicating whether or not we have 251 // Confirms that the javascript variable indicating whether or not we have
252 // a stale copy in the cache has been set to |expected|. 252 // a stale copy in the cache has been set to |expected|.
253 bool ProbeStaleCopyValue(bool expected) { 253 bool ProbeStaleCopyValue(bool expected) {
254 const char* js_cache_probe = 254 const char* js_cache_probe =
255 "try {\n" 255 "try {\n"
256 " domAutomationController.send(\n" 256 " domAutomationController.send(\n"
257 " templateData.staleCopyInCache ? 'yes' : 'no');\n" 257 " 'staleCopyInCache' in templateData ? 'yes' : 'no');\n"
258 "} catch (e) {\n" 258 "} catch (e) {\n"
259 " domAutomationController.send(e.message);\n" 259 " domAutomationController.send(e.message);\n"
260 "}\n"; 260 "}\n";
261 261
262 std::string result; 262 std::string result;
263 bool ret = 263 bool ret =
264 content::ExecuteScriptAndExtractString( 264 content::ExecuteScriptAndExtractString(
265 browser()->tab_strip_model()->GetActiveWebContents(), 265 browser()->tab_strip_model()->GetActiveWebContents(),
266 js_cache_probe, 266 js_cache_probe,
267 &result); 267 &result);
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 browser(), 931 browser(),
932 URLRequestFailedJob::GetMockHttpUrlForHostname(net::ERR_UNSAFE_PORT, 932 URLRequestFailedJob::GetMockHttpUrlForHostname(net::ERR_UNSAFE_PORT,
933 kHostname), 933 kHostname),
934 1); 934 1);
935 935
936 ToggleHelpBox(browser()); 936 ToggleHelpBox(browser());
937 EXPECT_TRUE(IsDisplayingText(browser(), kHostnameJSUnicode)); 937 EXPECT_TRUE(IsDisplayingText(browser(), kHostnameJSUnicode));
938 } 938 }
939 939
940 } // namespace 940 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698