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 #import "base/mac/bind_objc_block.h" | 5 #import "base/mac/bind_objc_block.h" |
6 #include "base/mac/foundation_util.h" | 6 #include "base/mac/foundation_util.h" |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #import "base/strings/sys_string_conversions.h" | 8 #import "base/strings/sys_string_conversions.h" |
9 #include "base/test/ios/wait_util.h" | 9 #include "base/test/ios/wait_util.h" |
10 #import "ios/web/public/navigation_item.h" | 10 #import "ios/web/public/navigation_item.h" |
11 #import "ios/web/public/navigation_manager.h" | 11 #import "ios/web/public/navigation_manager.h" |
12 #import "ios/web/public/test/http_server.h" | 12 #import "ios/web/public/test/http_server/http_server.h" |
13 #include "ios/web/public/test/http_server_util.h" | 13 #include "ios/web/public/test/http_server/http_server_util.h" |
14 #import "ios/web/public/test/web_view_interaction_test_util.h" | 14 #import "ios/web/public/test/web_view_interaction_test_util.h" |
15 #import "ios/web/public/web_state/web_state.h" | 15 #import "ios/web/public/web_state/web_state.h" |
16 #include "ios/web/public/web_state/web_state_observer.h" | 16 #include "ios/web/public/web_state/web_state_observer.h" |
17 #import "ios/web/test/web_int_test.h" | 17 #import "ios/web/test/web_int_test.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "testing/gtest_mac.h" | 19 #include "testing/gtest_mac.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 // URL for the test window.location test file. The page at this URL contains | 23 // URL for the test window.location test file. The page at this URL contains |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 SetWindowLocationUrl(sample_url); | 240 SetWindowLocationUrl(sample_url); |
241 ExecuteBlockAndWaitForLoad(sample_url, ^{ | 241 ExecuteBlockAndWaitForLoad(sample_url, ^{ |
242 ASSERT_TRUE(web::test::TapWebViewElementWithId( | 242 ASSERT_TRUE(web::test::TapWebViewElementWithId( |
243 web_state(), kWindowLocationSetToDOMStringID)); | 243 web_state(), kWindowLocationSetToDOMStringID)); |
244 }); | 244 }); |
245 | 245 |
246 // Verify that |sample_url| was loaded and that |about_blank_item| was pruned. | 246 // Verify that |sample_url| was loaded and that |about_blank_item| was pruned. |
247 EXPECT_EQ(sample_url, navigation_manager()->GetLastCommittedItem()->GetURL()); | 247 EXPECT_EQ(sample_url, navigation_manager()->GetLastCommittedItem()->GetURL()); |
248 EXPECT_EQ(NSNotFound, GetIndexOfNavigationItem(about_blank_item)); | 248 EXPECT_EQ(NSNotFound, GetIndexOfNavigationItem(about_blank_item)); |
249 } | 249 } |
OLD | NEW |