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 <utility> |
| 6 |
5 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
6 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
7 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
8 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
9 #include "content/public/browser/notification_service.h" | 11 #include "content/public/browser/notification_service.h" |
10 #include "content/public/browser/notification_types.h" | 12 #include "content/public/browser/notification_types.h" |
11 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
12 #include "content/public/common/url_constants.h" | 14 #include "content/public/common/url_constants.h" |
13 #include "content/public/test/browser_test_utils.h" | 15 #include "content/public/test/browser_test_utils.h" |
14 #include "content/public/test/content_browser_test.h" | 16 #include "content/public/test/content_browser_test.h" |
(...skipping 17 matching lines...) Expand all Loading... |
32 base::CompareCase::SENSITIVE)) | 34 base::CompareCase::SENSITIVE)) |
33 return scoped_ptr<net::test_server::HttpResponse>(); | 35 return scoped_ptr<net::test_server::HttpResponse>(); |
34 | 36 |
35 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 37 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
36 new net::test_server::BasicHttpResponse); | 38 new net::test_server::BasicHttpResponse); |
37 http_response->set_code(net::HTTP_OK); | 39 http_response->set_code(net::HTTP_OK); |
38 http_response->set_content( | 40 http_response->set_content( |
39 base::StringPrintf( | 41 base::StringPrintf( |
40 "<html><head><title>%s</title></head></html>", | 42 "<html><head><title>%s</title></head></html>", |
41 request.content.c_str())); | 43 request.content.c_str())); |
42 return http_response.Pass(); | 44 return std::move(http_response); |
43 } | 45 } |
44 | 46 |
45 } // namespace | 47 } // namespace |
46 | 48 |
47 class SessionHistoryTest : public ContentBrowserTest { | 49 class SessionHistoryTest : public ContentBrowserTest { |
48 protected: | 50 protected: |
49 SessionHistoryTest() {} | 51 SessionHistoryTest() {} |
50 | 52 |
51 void SetUpOnMainThread() override { | 53 void SetUpOnMainThread() override { |
52 ASSERT_TRUE(embedded_test_server()->Start()); | 54 ASSERT_TRUE(embedded_test_server()->Start()); |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 NavigateToURL(shell(), GetURL("title2.html")); | 493 NavigateToURL(shell(), GetURL("title2.html")); |
492 | 494 |
493 ASSERT_TRUE(ExecuteScriptAndExtractInt( | 495 ASSERT_TRUE(ExecuteScriptAndExtractInt( |
494 shell()->web_contents(), | 496 shell()->web_contents(), |
495 "domAutomationController.send(history.length)", | 497 "domAutomationController.send(history.length)", |
496 &length)); | 498 &length)); |
497 EXPECT_EQ(2, length); | 499 EXPECT_EQ(2, length); |
498 } | 500 } |
499 | 501 |
500 } // namespace content | 502 } // namespace content |
OLD | NEW |