| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 &success)); | 1336 &success)); |
| 1337 EXPECT_TRUE(success); | 1337 EXPECT_TRUE(success); |
| 1338 ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 1338 ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
| 1339 | 1339 |
| 1340 // At this point, we should no longer be showing the destination URL. | 1340 // At this point, we should no longer be showing the destination URL. |
| 1341 // The visible entry should be null, resulting in about:blank in the address | 1341 // The visible entry should be null, resulting in about:blank in the address |
| 1342 // bar. | 1342 // bar. |
| 1343 EXPECT_FALSE(contents->GetController().GetVisibleEntry()); | 1343 EXPECT_FALSE(contents->GetController().GetVisibleEntry()); |
| 1344 } | 1344 } |
| 1345 | 1345 |
| 1346 #if defined(OS_ANDROID) | |
| 1347 // Flaky on android: https://crbug.com/703657 | |
| 1348 #define MAYBE_DontShowLoadingURLIfNotInitialNav \ | |
| 1349 DISABLED_DontShowLoadingURLIfNotInitialNav | |
| 1350 #else | |
| 1351 #define MAYBE_DontShowLoadingURLIfNotInitialNav \ | |
| 1352 DontShowLoadingURLIfNotInitialNav | |
| 1353 #endif | |
| 1354 | |
| 1355 // Test for crbug.com/9682. We should not show the URL for a pending renderer- | 1346 // Test for crbug.com/9682. We should not show the URL for a pending renderer- |
| 1356 // initiated navigation in a new tab if it is not the initial navigation. In | 1347 // initiated navigation in a new tab if it is not the initial navigation. In |
| 1357 // this case, the renderer will not notify us of a modification, so we cannot | 1348 // this case, the renderer will not notify us of a modification, so we cannot |
| 1358 // show the pending URL without allowing a spoof. | 1349 // show the pending URL without allowing a spoof. |
| 1359 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, | 1350 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, |
| 1360 MAYBE_DontShowLoadingURLIfNotInitialNav) { | 1351 DontShowLoadingURLIfNotInitialNav) { |
| 1361 ASSERT_TRUE(embedded_test_server()->Start()); | 1352 ASSERT_TRUE(embedded_test_server()->Start()); |
| 1362 | 1353 |
| 1363 // Load a page that can open a URL that won't commit in a new window. | 1354 // Load a page that can open a URL that won't commit in a new window. |
| 1364 NavigateToURL(shell(), | 1355 NavigateToURL(shell(), |
| 1365 embedded_test_server()->GetURL("/click-nocontent-link.html")); | 1356 embedded_test_server()->GetURL("/click-nocontent-link.html")); |
| 1366 WebContents* orig_contents = shell()->web_contents(); | 1357 WebContents* orig_contents = shell()->web_contents(); |
| 1367 | 1358 |
| 1368 // Click a /nocontent link that opens in a new window but never commits. | 1359 // Click a /nocontent link that opens in a new window but never commits. |
| 1369 // By using an onclick handler that first creates the window, the slow | 1360 // By using an onclick handler that first creates the window, the slow |
| 1370 // navigation is not considered an initial navigation. | 1361 // navigation is not considered an initial navigation. |
| (...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3283 // than one ancestor has the same URL (excluding fragments), and the | 3274 // than one ancestor has the same URL (excluding fragments), and the |
| 3284 // navigating frame's current URL shouldn't count toward that. | 3275 // navigating frame's current URL shouldn't count toward that. |
| 3285 EXPECT_TRUE( | 3276 EXPECT_TRUE( |
| 3286 ExecuteScript(child, "location.href = '" + first_url.spec() + "';")); | 3277 ExecuteScript(child, "location.href = '" + first_url.spec() + "';")); |
| 3287 observer2.Wait(); | 3278 observer2.Wait(); |
| 3288 | 3279 |
| 3289 EXPECT_EQ(child->current_url(), first_url); | 3280 EXPECT_EQ(child->current_url(), first_url); |
| 3290 } | 3281 } |
| 3291 | 3282 |
| 3292 } // namespace content | 3283 } // namespace content |
| OLD | NEW |