OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/LinkLoader.h" | 5 #include "core/loader/LinkLoader.h" |
6 | 6 |
| 7 #include <base/macros.h> |
| 8 #include <memory> |
7 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
8 #include "core/html/LinkRelAttribute.h" | 10 #include "core/html/LinkRelAttribute.h" |
9 #include "core/loader/DocumentLoader.h" | 11 #include "core/loader/DocumentLoader.h" |
10 #include "core/loader/LinkLoaderClient.h" | 12 #include "core/loader/LinkLoaderClient.h" |
11 #include "core/loader/NetworkHintsInterface.h" | 13 #include "core/loader/NetworkHintsInterface.h" |
12 #include "core/testing/DummyPageHolder.h" | 14 #include "core/testing/DummyPageHolder.h" |
13 #include "platform/loader/fetch/MemoryCache.h" | 15 #include "platform/loader/fetch/MemoryCache.h" |
14 #include "platform/loader/fetch/ResourceFetcher.h" | 16 #include "platform/loader/fetch/ResourceFetcher.h" |
15 #include "platform/network/ResourceLoadPriority.h" | 17 #include "platform/network/ResourceLoadPriority.h" |
16 #include "platform/testing/URLTestHelpers.h" | 18 #include "platform/testing/URLTestHelpers.h" |
17 #include "public/platform/Platform.h" | 19 #include "public/platform/Platform.h" |
18 #include "public/platform/WebURLLoaderMockFactory.h" | 20 #include "public/platform/WebURLLoaderMockFactory.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
20 #include <base/macros.h> | |
21 #include <memory> | |
22 | 22 |
23 namespace blink { | 23 namespace blink { |
24 | 24 |
25 class MockLinkLoaderClient final | 25 class MockLinkLoaderClient final |
26 : public GarbageCollectedFinalized<MockLinkLoaderClient>, | 26 : public GarbageCollectedFinalized<MockLinkLoaderClient>, |
27 public LinkLoaderClient { | 27 public LinkLoaderClient { |
28 USING_GARBAGE_COLLECTED_MIXIN(MockLinkLoaderClient); | 28 USING_GARBAGE_COLLECTED_MIXIN(MockLinkLoaderClient); |
29 | 29 |
30 public: | 30 public: |
31 static MockLinkLoaderClient* create(bool shouldLoad) { | 31 static MockLinkLoaderClient* create(bool shouldLoad) { |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 loader->loadLink(LinkRelAttribute("preconnect"), testCase.crossOrigin, | 371 loader->loadLink(LinkRelAttribute("preconnect"), testCase.crossOrigin, |
372 String(), String(), String(), ReferrerPolicyDefault, | 372 String(), String(), String(), ReferrerPolicyDefault, |
373 hrefURL, dummyPageHolder->document(), networkHints); | 373 hrefURL, dummyPageHolder->document(), networkHints); |
374 EXPECT_EQ(testCase.shouldLoad, networkHints.didPreconnect()); | 374 EXPECT_EQ(testCase.shouldLoad, networkHints.didPreconnect()); |
375 EXPECT_EQ(testCase.isHTTPS, networkHints.isHTTPS()); | 375 EXPECT_EQ(testCase.isHTTPS, networkHints.isHTTPS()); |
376 EXPECT_EQ(testCase.isCrossOrigin, networkHints.isCrossOrigin()); | 376 EXPECT_EQ(testCase.isCrossOrigin, networkHints.isCrossOrigin()); |
377 } | 377 } |
378 } | 378 } |
379 | 379 |
380 } // namespace blink | 380 } // namespace blink |
OLD | NEW |