OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/memory/ptr_util.h" | 5 #include "base/memory/ptr_util.h" |
6 #include "blimp/client/core/contents/ime_feature.h" | 6 #include "blimp/client/core/contents/ime_feature.h" |
7 #include "blimp/client/core/contents/mock_ime_feature_delegate.h" | 7 #include "blimp/client/core/contents/mock_ime_feature_delegate.h" |
8 #include "blimp/client/core/contents/mock_navigation_feature_delegate.h" | 8 #include "blimp/client/core/contents/mock_navigation_feature_delegate.h" |
9 #include "blimp/client/core/contents/navigation_feature.h" | 9 #include "blimp/client/core/contents/navigation_feature.h" |
10 #include "blimp/client/core/contents/tab_control_feature.h" | 10 #include "blimp/client/core/contents/tab_control_feature.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 }; | 108 }; |
109 | 109 |
110 IN_PROC_BROWSER_TEST_F(EngineBrowserTest, LoadUrl) { | 110 IN_PROC_BROWSER_TEST_F(EngineBrowserTest, LoadUrl) { |
111 EXPECT_CALL(client_rw_feature_delegate_, OnRenderWidgetCreated(1)); | 111 EXPECT_CALL(client_rw_feature_delegate_, OnRenderWidgetCreated(1)); |
112 ExpectPageLoad(); | 112 ExpectPageLoad(); |
113 NavigateToLocalUrl("/page1.html"); | 113 NavigateToLocalUrl("/page1.html"); |
114 RunAndVerify(); | 114 RunAndVerify(); |
115 EXPECT_EQ("page1", last_page_title_); | 115 EXPECT_EQ("page1", last_page_title_); |
116 } | 116 } |
117 | 117 |
118 IN_PROC_BROWSER_TEST_F(EngineBrowserTest, GoBack) { | 118 IN_PROC_BROWSER_TEST_F(EngineBrowserTest, Reload) { |
119 ExpectPageLoad(); | 119 ExpectPageLoad(); |
120 NavigateToLocalUrl("/page1.html"); | 120 NavigateToLocalUrl("/page1.html"); |
121 RunAndVerify(); | 121 RunAndVerify(); |
122 EXPECT_EQ("page1", last_page_title_); | |
Kevin M
2016/08/29 23:31:52
Turn these into named constants that are declared
Brian Goldman
2016/08/29 23:38:16
This might just be a standard Chromium test style
Kevin M
2016/08/29 23:41:30
It is a general styleguide rule in Chromium/Google
Brian Goldman
2016/08/30 00:43:07
Done.
| |
123 | |
124 ExpectPageLoad(); | |
125 client_session_->GetNavigationFeature()->Reload(kDummyTabId); | |
126 RunAndVerify(); | |
127 EXPECT_EQ("page1", last_page_title_); | |
128 } | |
129 | |
130 IN_PROC_BROWSER_TEST_F(EngineBrowserTest, GoBackAndGoForward) { | |
131 ExpectPageLoad(); | |
132 NavigateToLocalUrl("/page1.html"); | |
133 RunAndVerify(); | |
122 EXPECT_EQ("page1", last_page_title_); | 134 EXPECT_EQ("page1", last_page_title_); |
123 | 135 |
124 ExpectPageLoad(); | 136 ExpectPageLoad(); |
125 NavigateToLocalUrl("/page2.html"); | 137 NavigateToLocalUrl("/page2.html"); |
126 RunAndVerify(); | 138 RunAndVerify(); |
127 EXPECT_EQ("page2", last_page_title_); | 139 EXPECT_EQ("page2", last_page_title_); |
128 | 140 |
129 ExpectPageLoad(); | 141 ExpectPageLoad(); |
130 client_session_->GetNavigationFeature()->GoBack(kDummyTabId); | 142 client_session_->GetNavigationFeature()->GoBack(kDummyTabId); |
131 RunAndVerify(); | 143 RunAndVerify(); |
132 EXPECT_EQ("page1", last_page_title_); | 144 EXPECT_EQ("page1", last_page_title_); |
145 | |
146 ExpectPageLoad(); | |
147 client_session_->GetNavigationFeature()->GoForward(kDummyTabId); | |
148 RunAndVerify(); | |
149 EXPECT_EQ("page2", last_page_title_); | |
133 } | 150 } |
134 | 151 |
Kevin M
2016/08/29 23:31:52
Would it make sense to also test going back with a
Brian Goldman
2016/08/29 23:38:16
I'm almost certain that right now in Blimp if the
Kevin M
2016/08/29 23:41:30
OK, could you investigate it for potentially addin
Brian Goldman
2016/08/30 00:43:07
Done.
| |
135 } // namespace | 152 } // namespace |
136 } // namespace blimp | 153 } // namespace blimp |
OLD | NEW |