| 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 <map> | 5 #include <map> |
| 6 #include <memory> | 6 #include <memory> |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 "var data_url = 'data:text/html,<script src=\"%s\"></script>';" | 844 "var data_url = 'data:text/html,<script src=\"%s\"></script>';" |
| 845 "window.frames[0][0].location.href = data_url;", | 845 "window.frames[0][0].location.href = data_url;", |
| 846 included_url.spec().c_str()))); | 846 included_url.spec().c_str()))); |
| 847 navigation_observer.Wait(); | 847 navigation_observer.Wait(); |
| 848 | 848 |
| 849 content::RenderFrameHost* target = content::FrameMatchingPredicate( | 849 content::RenderFrameHost* target = content::FrameMatchingPredicate( |
| 850 web_contents(), base::Bind([](content::RenderFrameHost* rfh) { | 850 web_contents(), base::Bind([](content::RenderFrameHost* rfh) { |
| 851 return rfh->GetLastCommittedURL().scheme_piece() == url::kDataScheme; | 851 return rfh->GetLastCommittedURL().scheme_piece() == url::kDataScheme; |
| 852 })); | 852 })); |
| 853 ASSERT_NE(target, nullptr); | 853 ASSERT_NE(target, nullptr); |
| 854 EXPECT_TRUE(target->GetLastCommittedOrigin().unique()); | 854 EXPECT_TRUE(target->GetLastCommittedOrigin().opaque()); |
| 855 | 855 |
| 856 EXPECT_EQ(content::AreAllSitesIsolatedForTesting(), | 856 EXPECT_EQ(content::AreAllSitesIsolatedForTesting(), |
| 857 WasParsedScriptElementLoaded(target)); | 857 WasParsedScriptElementLoaded(target)); |
| 858 } | 858 } |
| 859 | 859 |
| 860 IN_PROC_BROWSER_TEST_F(SubresourceFilterBrowserTest, | 860 IN_PROC_BROWSER_TEST_F(SubresourceFilterBrowserTest, |
| 861 HistoryNavigationActivation) { | 861 HistoryNavigationActivation) { |
| 862 content::ConsoleObserverDelegate console_observer(web_contents(), | 862 content::ConsoleObserverDelegate console_observer(web_contents(), |
| 863 kActivationConsoleMessage); | 863 kActivationConsoleMessage); |
| 864 web_contents()->SetDelegate(&console_observer); | 864 web_contents()->SetDelegate(&console_observer); |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1948 std::string(kSubresourceFilterOnlySuffix), | 1948 std::string(kSubresourceFilterOnlySuffix), |
| 1949 false, 1); | 1949 false, 1); |
| 1950 | 1950 |
| 1951 tester.ExpectUniqueSample(std::string(kMatchesPatternHistogramName) + | 1951 tester.ExpectUniqueSample(std::string(kMatchesPatternHistogramName) + |
| 1952 std::string(kPhishingInterstitialSuffix), | 1952 std::string(kPhishingInterstitialSuffix), |
| 1953 false, 1); | 1953 false, 1); |
| 1954 } | 1954 } |
| 1955 #endif | 1955 #endif |
| 1956 | 1956 |
| 1957 } // namespace subresource_filter | 1957 } // namespace subresource_filter |
| OLD | NEW |