| 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 "core/html/HTMLMediaElement.h" | 5 #include "core/html/HTMLMediaElement.h" |
| 6 | 6 |
| 7 #include "core/frame/Settings.h" | 7 #include "core/frame/Settings.h" |
| 8 #include "core/html/HTMLAudioElement.h" | 8 #include "core/html/HTMLAudioElement.h" |
| 9 #include "core/html/HTMLVideoElement.h" | 9 #include "core/html/HTMLVideoElement.h" |
| 10 #include "core/page/NetworkStateNotifier.h" | 10 #include "core/page/NetworkStateNotifier.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 return "ftp://example.com/foo.mp4"; | 80 return "ftp://example.com/foo.mp4"; |
| 81 case TestURLScheme::kFile: | 81 case TestURLScheme::kFile: |
| 82 return "file:///foo/bar.mp4"; | 82 return "file:///foo/bar.mp4"; |
| 83 case TestURLScheme::kData: | 83 case TestURLScheme::kData: |
| 84 return "data:video/mp4;base64,XXXXXXX"; | 84 return "data:video/mp4;base64,XXXXXXX"; |
| 85 case TestURLScheme::kBlob: | 85 case TestURLScheme::kBlob: |
| 86 return "blob:http://example.com/00000000-0000-0000-0000-000000000000"; | 86 return "blob:http://example.com/00000000-0000-0000-0000-000000000000"; |
| 87 default: | 87 default: |
| 88 NOTREACHED(); | 88 NOTREACHED(); |
| 89 } | 89 } |
| 90 return emptyString(); | 90 return emptyString; |
| 91 } | 91 } |
| 92 | 92 |
| 93 TEST_P(HTMLMediaElementTest, preloadType) { | 93 TEST_P(HTMLMediaElementTest, preloadType) { |
| 94 struct TestData { | 94 struct TestData { |
| 95 bool dataSaverEnabled; | 95 bool dataSaverEnabled; |
| 96 bool forcePreloadNoneForMediaElements; | 96 bool forcePreloadNoneForMediaElements; |
| 97 bool isCellular; | 97 bool isCellular; |
| 98 TestURLScheme srcScheme; | 98 TestURLScheme srcScheme; |
| 99 AtomicString preloadToSet; | 99 AtomicString preloadToSet; |
| 100 AtomicString preloadExpected; | 100 AtomicString preloadExpected; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 setCurrentSrc(srcSchemeToURL(data.srcScheme)); | 132 setCurrentSrc(srcSchemeToURL(data.srcScheme)); |
| 133 media()->setPreload(data.preloadToSet); | 133 media()->setPreload(data.preloadToSet); |
| 134 | 134 |
| 135 EXPECT_EQ(data.preloadExpected, media()->preload()) | 135 EXPECT_EQ(data.preloadExpected, media()->preload()) |
| 136 << "preload type differs at index" << index; | 136 << "preload type differs at index" << index; |
| 137 ++index; | 137 ++index; |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace blink | 141 } // namespace blink |
| OLD | NEW |