| 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 <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url1, 1); | 952 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url1, 1); |
| 953 Attach(); | 953 Attach(); |
| 954 | 954 |
| 955 GURL test_url2 = embedded_test_server()->GetURL( | 955 GURL test_url2 = embedded_test_server()->GetURL( |
| 956 "B.com", "/devtools/navigation.html"); | 956 "B.com", "/devtools/navigation.html"); |
| 957 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url2, 1); | 957 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url2, 1); |
| 958 | 958 |
| 959 EXPECT_EQ(0u, notifications_.size()); | 959 EXPECT_EQ(0u, notifications_.size()); |
| 960 } | 960 } |
| 961 | 961 |
| 962 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, CrossSiteCrash) { |
| 963 set_agent_host_can_close(); |
| 964 host_resolver()->AddRule("*", "127.0.0.1"); |
| 965 content::SetupCrossSiteRedirector(embedded_test_server()); |
| 966 ASSERT_TRUE(embedded_test_server()->Start()); |
| 967 |
| 968 GURL test_url1 = |
| 969 embedded_test_server()->GetURL("A.com", "/devtools/navigation.html"); |
| 970 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url1, 1); |
| 971 Attach(); |
| 972 CrashTab(shell()->web_contents()); |
| 973 |
| 974 GURL test_url2 = |
| 975 embedded_test_server()->GetURL("B.com", "/devtools/navigation.html"); |
| 976 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url2, 1); |
| 977 |
| 978 // Should not crash at this point. |
| 979 } |
| 980 |
| 962 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, ReconnectPreservesState) { | 981 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, ReconnectPreservesState) { |
| 963 ASSERT_TRUE(embedded_test_server()->Start()); | 982 ASSERT_TRUE(embedded_test_server()->Start()); |
| 964 GURL test_url = embedded_test_server()->GetURL("/devtools/navigation.html"); | 983 GURL test_url = embedded_test_server()->GetURL("/devtools/navigation.html"); |
| 965 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1); | 984 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1); |
| 966 | 985 |
| 967 Shell* second = CreateBrowser(); | 986 Shell* second = CreateBrowser(); |
| 968 NavigateToURLBlockUntilNavigationsComplete(second, test_url, 1); | 987 NavigateToURLBlockUntilNavigationsComplete(second, test_url, 1); |
| 969 | 988 |
| 970 Attach(); | 989 Attach(); |
| 971 SendCommand("Runtime.enable", nullptr); | 990 SendCommand("Runtime.enable", nullptr); |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1800 EXPECT_EQ("polyglottal", value); | 1819 EXPECT_EQ("polyglottal", value); |
| 1801 found++; | 1820 found++; |
| 1802 } else { | 1821 } else { |
| 1803 FAIL(); | 1822 FAIL(); |
| 1804 } | 1823 } |
| 1805 } | 1824 } |
| 1806 EXPECT_EQ(2u, found); | 1825 EXPECT_EQ(2u, found); |
| 1807 } | 1826 } |
| 1808 | 1827 |
| 1809 } // namespace content | 1828 } // namespace content |
| OLD | NEW |