| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "chrome/common/url_constants.h" | 6 #include "chrome/common/url_constants.h" |
| 7 #include "chrome/test/automation/automation_proxy.h" | 7 #include "chrome/test/automation/automation_proxy.h" |
| 8 #include "chrome/test/automation/browser_proxy.h" | 8 #include "chrome/test/automation/browser_proxy.h" |
| 9 #include "chrome/test/automation/tab_proxy.h" | 9 #include "chrome/test/automation/tab_proxy.h" |
| 10 #include "chrome/test/ui/ui_test.h" | 10 #include "chrome/test/ui/ui_test.h" |
| 11 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
| 12 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
| 13 #include "net/test/test_server.h" | 13 #include "net/test/test_server.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 class SessionHistoryTest : public UITest { | 17 class SessionHistoryTest : public UITest { |
| 18 protected: | 18 protected: |
| 19 SessionHistoryTest() | 19 SessionHistoryTest() |
| 20 : test_server_(net::TestServer::TYPE_HTTP, | 20 : test_server_(net::TestServer::TYPE_HTTP, |
| 21 net::TestServer::kLocalhost, |
| 21 FilePath(FILE_PATH_LITERAL("chrome/test/data"))) { | 22 FilePath(FILE_PATH_LITERAL("chrome/test/data"))) { |
| 22 dom_automation_enabled_ = true; | 23 dom_automation_enabled_ = true; |
| 23 } | 24 } |
| 24 | 25 |
| 25 virtual void SetUp() { | 26 virtual void SetUp() { |
| 26 UITest::SetUp(); | 27 UITest::SetUp(); |
| 27 | 28 |
| 28 window_ = automation()->GetBrowserWindow(0); | 29 window_ = automation()->GetBrowserWindow(0); |
| 29 ASSERT_TRUE(window_.get()); | 30 ASSERT_TRUE(window_.get()); |
| 30 | 31 |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 ASSERT_TRUE(tab_->GoBack()); | 558 ASSERT_TRUE(tab_->GoBack()); |
| 558 | 559 |
| 559 // Ensure history.length is properly truncated. | 560 // Ensure history.length is properly truncated. |
| 560 ASSERT_TRUE(tab_->NavigateToURL(test_server_.GetURL("files/title2.html"))); | 561 ASSERT_TRUE(tab_->NavigateToURL(test_server_.GetURL("files/title2.html"))); |
| 561 ASSERT_TRUE(tab_->ExecuteAndExtractInt( | 562 ASSERT_TRUE(tab_->ExecuteAndExtractInt( |
| 562 L"", L"domAutomationController.send(history.length)", &length)); | 563 L"", L"domAutomationController.send(history.length)", &length)); |
| 563 EXPECT_EQ(2, length); | 564 EXPECT_EQ(2, length); |
| 564 } | 565 } |
| 565 | 566 |
| 566 } // namespace | 567 } // namespace |
| OLD | NEW |