| 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" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 ASSERT_FALSE(tab_->GoBack()); | 139 ASSERT_FALSE(tab_->GoBack()); |
| 140 EXPECT_EQ(L"about:blank", GetTabTitle()); | 140 EXPECT_EQ(L"about:blank", GetTabTitle()); |
| 141 | 141 |
| 142 ASSERT_TRUE(tab_->GoForward()); | 142 ASSERT_TRUE(tab_->GoForward()); |
| 143 EXPECT_EQ(L"bot1", GetTabTitle()); | 143 EXPECT_EQ(L"bot1", GetTabTitle()); |
| 144 | 144 |
| 145 ASSERT_TRUE(tab_->GoForward()); | 145 ASSERT_TRUE(tab_->GoForward()); |
| 146 EXPECT_EQ(L"bot3", GetTabTitle()); | 146 EXPECT_EQ(L"bot3", GetTabTitle()); |
| 147 } | 147 } |
| 148 | 148 |
| 149 #if defined(OS_WIN) || defined(OS_MAC) | |
| 150 // See http://crbug.com/61619 | |
| 151 #define MAYBE_FrameBackForward FLAKY_FrameBackForward | |
| 152 #else | |
| 153 #define MAYBE_FrameBackForward FrameBackForward | |
| 154 #endif | |
| 155 | |
| 156 // Test that back/forward works when navigating in subframes. | 149 // Test that back/forward works when navigating in subframes. |
| 157 TEST_F(SessionHistoryTest, MAYBE_FrameBackForward) { | 150 TEST_F(SessionHistoryTest, FrameBackForward) { |
| 158 ASSERT_TRUE(test_server_.Start()); | 151 ASSERT_TRUE(test_server_.Start()); |
| 159 | 152 |
| 160 // about:blank should be loaded first. | 153 // about:blank should be loaded first. |
| 161 GURL home(homepage()); | 154 GURL home(homepage()); |
| 162 ASSERT_FALSE(tab_->GoBack()); | 155 ASSERT_FALSE(tab_->GoBack()); |
| 163 EXPECT_EQ(L"about:blank", GetTabTitle()); | 156 EXPECT_EQ(L"about:blank", GetTabTitle()); |
| 164 EXPECT_EQ(home, GetTabURL()); | 157 EXPECT_EQ(home, GetTabURL()); |
| 165 | 158 |
| 166 GURL frames(test_server_.GetURL("files/session_history/frames.html")); | 159 GURL frames(test_server_.GetURL("files/session_history/frames.html")); |
| 167 ASSERT_TRUE(tab_->NavigateToURL(frames)); | 160 ASSERT_TRUE(tab_->NavigateToURL(frames)); |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 ASSERT_TRUE(tab_->GoBack()); | 553 ASSERT_TRUE(tab_->GoBack()); |
| 561 | 554 |
| 562 // Ensure history.length is properly truncated. | 555 // Ensure history.length is properly truncated. |
| 563 ASSERT_TRUE(tab_->NavigateToURL(test_server_.GetURL("files/title2.html"))); | 556 ASSERT_TRUE(tab_->NavigateToURL(test_server_.GetURL("files/title2.html"))); |
| 564 ASSERT_TRUE(tab_->ExecuteAndExtractInt( | 557 ASSERT_TRUE(tab_->ExecuteAndExtractInt( |
| 565 L"", L"domAutomationController.send(history.length)", &length)); | 558 L"", L"domAutomationController.send(history.length)", &length)); |
| 566 EXPECT_EQ(2, length); | 559 EXPECT_EQ(2, length); |
| 567 } | 560 } |
| 568 | 561 |
| 569 } // namespace | 562 } // namespace |
| OLD | NEW |