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/strings/string_util.h" | 5 #include "base/strings/string_util.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/public/browser/navigation_controller.h" | 8 #include "content/public/browser/navigation_controller.h" |
9 #include "content/public/browser/notification_service.h" | 9 #include "content/public/browser/notification_service.h" |
10 #include "content/public/browser/notification_types.h" | 10 #include "content/public/browser/notification_types.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return http_response.Pass(); | 42 return http_response.Pass(); |
43 } | 43 } |
44 | 44 |
45 } // namespace | 45 } // namespace |
46 | 46 |
47 class SessionHistoryTest : public ContentBrowserTest { | 47 class SessionHistoryTest : public ContentBrowserTest { |
48 protected: | 48 protected: |
49 SessionHistoryTest() {} | 49 SessionHistoryTest() {} |
50 | 50 |
51 void SetUpOnMainThread() override { | 51 void SetUpOnMainThread() override { |
52 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 52 ASSERT_TRUE(embedded_test_server()->Start()); |
53 embedded_test_server()->RegisterRequestHandler( | 53 embedded_test_server()->RegisterRequestHandler( |
54 base::Bind(&HandleEchoTitleRequest, "/echotitle")); | 54 base::Bind(&HandleEchoTitleRequest, "/echotitle")); |
55 | 55 |
56 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); | 56 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); |
57 } | 57 } |
58 | 58 |
59 // Simulate clicking a link. Only works on the frames.html testserver page. | 59 // Simulate clicking a link. Only works on the frames.html testserver page. |
60 void ClickLink(const std::string& node_id) { | 60 void ClickLink(const std::string& node_id) { |
61 GURL url("javascript:clickLink('" + node_id + "')"); | 61 GURL url("javascript:clickLink('" + node_id + "')"); |
62 NavigateToURL(shell(), url); | 62 NavigateToURL(shell(), url); |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 NavigateToURL(shell(), GetURL("title2.html")); | 491 NavigateToURL(shell(), GetURL("title2.html")); |
492 | 492 |
493 ASSERT_TRUE(ExecuteScriptAndExtractInt( | 493 ASSERT_TRUE(ExecuteScriptAndExtractInt( |
494 shell()->web_contents(), | 494 shell()->web_contents(), |
495 "domAutomationController.send(history.length)", | 495 "domAutomationController.send(history.length)", |
496 &length)); | 496 &length)); |
497 EXPECT_EQ(2, length); | 497 EXPECT_EQ(2, length); |
498 } | 498 } |
499 | 499 |
500 } // namespace content | 500 } // namespace content |
OLD | NEW |