| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "core/loader/MixedContentChecker.h" | 5 #include "core/loader/MixedContentChecker.h" |
| 6 | 6 |
| 7 #include <base/macros.h> | 7 #include <base/macros.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/loader/EmptyClients.h" | 10 #include "core/loader/EmptyClients.h" |
| 11 #include "core/testing/DummyPageHolder.h" | 11 #include "core/testing/DummyPageHolder.h" |
| 12 #include "platform/loader/fetch/ResourceResponse.h" | 12 #include "platform/loader/fetch/ResourceResponse.h" |
| 13 #include "platform/weborigin/KURL.h" | 13 #include "platform/weborigin/KURL.h" |
| 14 #include "platform/weborigin/SecurityOrigin.h" | 14 #include "platform/weborigin/SecurityOrigin.h" |
| 15 #include "platform/wtf/RefPtr.h" |
| 15 #include "public/platform/WebMixedContent.h" | 16 #include "public/platform/WebMixedContent.h" |
| 16 #include "public/platform/WebMixedContentContextType.h" | 17 #include "public/platform/WebMixedContentContextType.h" |
| 17 #include "testing/gmock/include/gmock/gmock-generated-function-mockers.h" | 18 #include "testing/gmock/include/gmock/gmock-generated-function-mockers.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "wtf/RefPtr.h" | |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 | 22 |
| 23 // Tests that MixedContentChecker::isMixedContent correctly detects or ignores | 23 // Tests that MixedContentChecker::isMixedContent correctly detects or ignores |
| 24 // many cases where there is or there is not mixed content, respectively. | 24 // many cases where there is or there is not mixed content, respectively. |
| 25 // Note: Renderer side version of | 25 // Note: Renderer side version of |
| 26 // MixedContentNavigationThrottleTest.IsMixedContent. Must be kept in sync | 26 // MixedContentNavigationThrottleTest.IsMixedContent. Must be kept in sync |
| 27 // manually! | 27 // manually! |
| 28 TEST(MixedContentCheckerTest, IsMixedContent) { | 28 TEST(MixedContentCheckerTest, IsMixedContent) { |
| 29 struct TestCase { | 29 struct TestCase { |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 SecurityViolationReportingPolicy::kSuppressReporting)); | 174 SecurityViolationReportingPolicy::kSuppressReporting)); |
| 175 EXPECT_FALSE(MixedContentChecker::IsMixedFormAction( | 175 EXPECT_FALSE(MixedContentChecker::IsMixedFormAction( |
| 176 &dummy_page_holder->GetFrame(), javascript_form_action_url, | 176 &dummy_page_holder->GetFrame(), javascript_form_action_url, |
| 177 SecurityViolationReportingPolicy::kSuppressReporting)); | 177 SecurityViolationReportingPolicy::kSuppressReporting)); |
| 178 EXPECT_TRUE(MixedContentChecker::IsMixedFormAction( | 178 EXPECT_TRUE(MixedContentChecker::IsMixedFormAction( |
| 179 &dummy_page_holder->GetFrame(), mailto_form_action_url, | 179 &dummy_page_holder->GetFrame(), mailto_form_action_url, |
| 180 SecurityViolationReportingPolicy::kSuppressReporting)); | 180 SecurityViolationReportingPolicy::kSuppressReporting)); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace blink | 183 } // namespace blink |
| OLD | NEW |