| 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/testing/DummyPageHolder.h" | 10 #include "core/testing/DummyPageHolder.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 {false, false, false, TestURLScheme::kHttp, "foo", "auto"}, | 118 {false, false, false, TestURLScheme::kHttp, "foo", "auto"}, |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 int index = 0; | 121 int index = 0; |
| 122 for (const auto& data : test_data) { | 122 for (const auto& data : test_data) { |
| 123 Media()->GetDocument().GetSettings()->SetDataSaverEnabled( | 123 Media()->GetDocument().GetSettings()->SetDataSaverEnabled( |
| 124 data.data_saver_enabled); | 124 data.data_saver_enabled); |
| 125 Media()->GetDocument().GetSettings()->SetForcePreloadNoneForMediaElements( | 125 Media()->GetDocument().GetSettings()->SetForcePreloadNoneForMediaElements( |
| 126 data.force_preload_none_for_media_elements); | 126 data.force_preload_none_for_media_elements); |
| 127 if (data.is_cellular) { | 127 if (data.is_cellular) { |
| 128 GetNetworkStateNotifier().SetOverride( | 128 GetNetworkStateNotifier().SetNetworkConnectionInfoOverride( |
| 129 true, WebConnectionType::kWebConnectionTypeCellular3G, 2.0); | 129 true, WebConnectionType::kWebConnectionTypeCellular3G, 2.0); |
| 130 } else { | 130 } else { |
| 131 GetNetworkStateNotifier().ClearOverride(); | 131 GetNetworkStateNotifier().ClearOverride(); |
| 132 } | 132 } |
| 133 SetCurrentSrc(SrcSchemeToURL(data.src_scheme)); | 133 SetCurrentSrc(SrcSchemeToURL(data.src_scheme)); |
| 134 Media()->setPreload(data.preload_to_set); | 134 Media()->setPreload(data.preload_to_set); |
| 135 | 135 |
| 136 EXPECT_EQ(data.preload_expected, Media()->preload()) | 136 EXPECT_EQ(data.preload_expected, Media()->preload()) |
| 137 << "preload type differs at index" << index; | 137 << "preload type differs at index" << index; |
| 138 ++index; | 138 ++index; |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace blink | 142 } // namespace blink |
| OLD | NEW |