OLD | NEW |
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/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 NavigateHistory(num_navigations, HISTORY_NAVIGATE_FORWARD); | 350 NavigateHistory(num_navigations, HISTORY_NAVIGATE_FORWARD); |
351 } | 351 } |
352 | 352 |
353 // Confirms that the javascript variable indicating whether or not we have | 353 // Confirms that the javascript variable indicating whether or not we have |
354 // a stale copy in the cache has been set to |expected|, and that the | 354 // a stale copy in the cache has been set to |expected|, and that the |
355 // stale load button is or isn't there based on the same expectation. | 355 // stale load button is or isn't there based on the same expectation. |
356 testing::AssertionResult ProbeStaleCopyValue(bool expected) { | 356 testing::AssertionResult ProbeStaleCopyValue(bool expected) { |
357 const char* js_cache_probe = | 357 const char* js_cache_probe = |
358 "try {\n" | 358 "try {\n" |
359 " domAutomationController.send(\n" | 359 " domAutomationController.send(\n" |
360 " 'staleLoadButton' in templateData ? 'yes' : 'no');\n" | 360 " loadTimeData.valueExists('staleLoadButton') ? 'yes' : 'no');\n" |
361 "} catch (e) {\n" | 361 "} catch (e) {\n" |
362 " domAutomationController.send(e.message);\n" | 362 " domAutomationController.send(e.message);\n" |
363 "}\n"; | 363 "}\n"; |
364 | 364 |
365 std::string result; | 365 std::string result; |
366 bool ret = | 366 bool ret = |
367 content::ExecuteScriptAndExtractString( | 367 content::ExecuteScriptAndExtractString( |
368 browser()->tab_strip_model()->GetActiveWebContents(), | 368 browser()->tab_strip_model()->GetActiveWebContents(), |
369 js_cache_probe, | 369 js_cache_probe, |
370 &result); | 370 &result); |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 browser(), | 1098 browser(), |
1099 URLRequestFailedJob::GetMockHttpUrlForHostname(net::ERR_UNSAFE_PORT, | 1099 URLRequestFailedJob::GetMockHttpUrlForHostname(net::ERR_UNSAFE_PORT, |
1100 kHostname), | 1100 kHostname), |
1101 1); | 1101 1); |
1102 | 1102 |
1103 ToggleHelpBox(browser()); | 1103 ToggleHelpBox(browser()); |
1104 EXPECT_TRUE(IsDisplayingText(browser(), kHostnameJSUnicode)); | 1104 EXPECT_TRUE(IsDisplayingText(browser(), kHostnameJSUnicode)); |
1105 } | 1105 } |
1106 | 1106 |
1107 } // namespace | 1107 } // namespace |
OLD | NEW |