OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tab_proxy.h" | 7 #include "chrome/test/automation/tab_proxy.h" |
8 #include "chrome/test/automation/browser_proxy.h" | 8 #include "chrome/test/automation/browser_proxy.h" |
9 #include "chrome/test/ui/ui_test.h" | 9 #include "chrome/test/ui/ui_test.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 #define MAYBE_FrameBackForward FLAKY_FrameBackForward | 149 #define MAYBE_FrameBackForward FLAKY_FrameBackForward |
150 #else | 150 #else |
151 #define MAYBE_FrameBackForward FrameBackForward | 151 #define MAYBE_FrameBackForward FrameBackForward |
152 #endif | 152 #endif |
153 | 153 |
154 // Test that back/forward works when navigating in subframes. | 154 // Test that back/forward works when navigating in subframes. |
155 TEST_F(SessionHistoryTest, MAYBE_FrameBackForward) { | 155 TEST_F(SessionHistoryTest, MAYBE_FrameBackForward) { |
156 ASSERT_TRUE(test_server_.Start()); | 156 ASSERT_TRUE(test_server_.Start()); |
157 | 157 |
158 // about:blank should be loaded first. | 158 // about:blank should be loaded first. |
159 GURL home(homepage_); | 159 GURL home(homepage()); |
160 ASSERT_FALSE(tab_->GoBack()); | 160 ASSERT_FALSE(tab_->GoBack()); |
161 EXPECT_EQ(L"", GetTabTitle()); | 161 EXPECT_EQ(L"", GetTabTitle()); |
162 EXPECT_EQ(home, GetTabURL()); | 162 EXPECT_EQ(home, GetTabURL()); |
163 | 163 |
164 GURL frames(test_server_.GetURL("files/session_history/frames.html")); | 164 GURL frames(test_server_.GetURL("files/session_history/frames.html")); |
165 ASSERT_TRUE(tab_->NavigateToURL(frames)); | 165 ASSERT_TRUE(tab_->NavigateToURL(frames)); |
166 EXPECT_EQ(L"bot1", GetTabTitle()); | 166 EXPECT_EQ(L"bot1", GetTabTitle()); |
167 EXPECT_EQ(frames, GetTabURL()); | 167 EXPECT_EQ(frames, GetTabURL()); |
168 | 168 |
169 ClickLink("abot2"); | 169 ClickLink("abot2"); |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 ASSERT_TRUE(tab_->GoBack()); | 564 ASSERT_TRUE(tab_->GoBack()); |
565 | 565 |
566 // Ensure history.length is properly truncated. | 566 // Ensure history.length is properly truncated. |
567 ASSERT_TRUE(tab_->NavigateToURL(test_server_.GetURL("files/title2.html"))); | 567 ASSERT_TRUE(tab_->NavigateToURL(test_server_.GetURL("files/title2.html"))); |
568 ASSERT_TRUE(tab_->ExecuteAndExtractInt( | 568 ASSERT_TRUE(tab_->ExecuteAndExtractInt( |
569 L"", L"domAutomationController.send(history.length)", &length)); | 569 L"", L"domAutomationController.send(history.length)", &length)); |
570 EXPECT_EQ(2, length); | 570 EXPECT_EQ(2, length); |
571 } | 571 } |
572 | 572 |
573 } // namespace | 573 } // namespace |
OLD | NEW |