diff --git a/DEPS b/DEPS index 8770fb9..2c977eba 100644 --- a/DEPS +++ b/DEPS
@@ -86,7 +86,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': 'e30edd6fcb9625e62985548917340360811e0d93', + 'angle_revision': '8225e73bb30f39848616d98ae837b12502861c71', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling build tools # and whatever else without interference from each other. @@ -130,7 +130,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': 'dc9404644cac587e0bdc26f4430498f00e8ba3a2', + 'catapult_revision': 'a51f10541a1cd8f6bc96b0f7e9366ef651680769', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other.
diff --git a/base/debug/stack_trace_fuchsia.cc b/base/debug/stack_trace_fuchsia.cc index ea428b9..f996933 100644 --- a/base/debug/stack_trace_fuchsia.cc +++ b/base/debug/stack_trace_fuchsia.cc
@@ -63,7 +63,9 @@ Entry* GetForAddress(void* address); private: - static const size_t kMaxMapEntries = 64; + // Component builds of Chrome pull about 250 shared libraries (on Linux), so + // 512 entries should be enough in most cases. + static const size_t kMaxMapEntries = 512; void Populate(); @@ -116,7 +118,6 @@ } // Retrieve the debug info struct. - constexpr size_t map_capacity = sizeof(entries_); uintptr_t debug_addr; status = zx_object_get_property(process, ZX_PROP_PROCESS_DEBUG_ADDR, &debug_addr, sizeof(debug_addr)); @@ -135,7 +136,7 @@ // Copy the contents of the link map linked list to |entries_|. while (lmap != nullptr) { - if (count_ == map_capacity) { + if (count_ >= arraysize(entries_)) { break; } SymbolMap::Entry* next_entry = &entries_[count_];
diff --git a/build/fuchsia/runner_common.py b/build/fuchsia/runner_common.py index 8d88933..ba81b0e 100755 --- a/build/fuchsia/runner_common.py +++ b/build/fuchsia/runner_common.py
@@ -567,9 +567,9 @@ # Back-trace line matcher/parser assumes that 'pc' is always present, and # expects that 'sp' and ('binary','pc_offset') may also be provided. backtrace_entry = re.compile( - r'pc 0(?:x[0-9a-f]+)? ' + - r'(?:sp 0x[0-9a-f]+ )?' + - r'(?:\((?P<binary>\S+),(?P<pc_offset>0x[0-9a-f]+)\))?$') + r'pc 0(?:x[0-9a-f]+)?' + + r'(?: sp 0x[0-9a-f]+)?' + + r'(?: \((?P<binary>\S+),(?P<pc_offset>0x[0-9a-f]+)\))?$') # A buffer of backtrace entries awaiting symbolization, stored as dicts: # raw: The original back-trace line that followed the prefix.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java index 33db334..a8082c24 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
@@ -763,7 +763,7 @@ // Note that we don't want to dispatch vrdisplayactivate for auto-present and vr intents. boolean tentativeWebVrMode = mListeningForWebVrActivateBeforePause && !mRequestedWebVr && !mEnterVrOnStartup; - if (tentativeWebVrMode) { + if (tentativeWebVrMode && !mAutopresentWebVr) { // Before we fire DisplayActivate, we need focus to propagate to the WebContents we're // about to send DisplayActivate to. Focus propagates during onResume, which is when // this function is called, so if we post DisplayActivate to fire after onResume, focus
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/appmenu/ChromeHomeAppMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/appmenu/ChromeHomeAppMenuTest.java index 6b2e0d7..e4d24dd2 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/appmenu/ChromeHomeAppMenuTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/appmenu/ChromeHomeAppMenuTest.java
@@ -8,6 +8,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import android.os.Build; import android.support.annotation.Nullable; import android.support.test.InstrumentationRegistry; import android.support.test.filters.SmallTest; @@ -25,6 +26,7 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.DisableIf; import org.chromium.base.test.util.Restriction; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; @@ -235,6 +237,7 @@ @Test @SmallTest @CommandLineFlags.Add({"enable-features=" + ChromeFeatureList.CHROME_HOME_PROMO}) + @DisableIf.Build(sdk_is_greater_than = Build.VERSION_CODES.N_MR1, message = "crbug.com/786454") public void testPromoAppMenuHeader() throws InterruptedException, TimeoutException { // Create a callback to be notified when the dialog is shown. final CallbackHelper dialogShownCallback = new CallbackHelper();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/searchwidget/SearchActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/searchwidget/SearchActivityTest.java index 211ab85..01e63a6 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/searchwidget/SearchActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/searchwidget/SearchActivityTest.java
@@ -26,6 +26,7 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.RetryOnFailure; import org.chromium.base.test.util.ScalableTimeout; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeSwitches; @@ -242,6 +243,7 @@ @Test @SmallTest + @RetryOnFailure(message = "crbug.com/765476") public void testEnterUrlBeforeNativeIsLoaded() throws Exception { // Wait for the activity to load, but don't let it load the native library. mTestDelegate.shouldDelayLoadingNative = true;
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 432f97f0..5cc3e6f 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -2579,6 +2579,8 @@ "resource_coordinator/tab_lifecycle_unit.h", "resource_coordinator/tab_lifecycle_unit_external.cc", "resource_coordinator/tab_lifecycle_unit_external.h", + "resource_coordinator/tab_lifecycle_unit_source.cc", + "resource_coordinator/tab_lifecycle_unit_source.h", "resource_coordinator/tab_manager.cc", "resource_coordinator/tab_manager.h", "resource_coordinator/tab_manager_delegate_chromeos.cc",
diff --git a/chrome/browser/chromeos/smb_client/smb_service.cc b/chrome/browser/chromeos/smb_client/smb_service.cc index 03eb11ae..d9bbce16 100644 --- a/chrome/browser/chromeos/smb_client/smb_service.cc +++ b/chrome/browser/chromeos/smb_client/smb_service.cc
@@ -50,7 +50,7 @@ return; } - DCHECK_GT(mount_id, 0); + DCHECK_GE(mount_id, 0); file_system_provider::MountOptions mount_options(options); mount_options.file_system_id = base::NumberToString(mount_id);
diff --git a/chrome/browser/chromeos/system_logs/command_line_log_source.cc b/chrome/browser/chromeos/system_logs/command_line_log_source.cc index 1a928f8..d4434e7 100644 --- a/chrome/browser/chromeos/system_logs/command_line_log_source.cc +++ b/chrome/browser/chromeos/system_logs/command_line_log_source.cc
@@ -98,7 +98,7 @@ CommandLineLogSource::~CommandLineLogSource() { } -void CommandLineLogSource::Fetch(const SysLogsSourceCallback& callback) { +void CommandLineLogSource::Fetch(SysLogsSourceCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(!callback.is_null()); @@ -107,7 +107,7 @@ base::PostTaskWithTraitsAndReply( FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, base::BindOnce(&ExecuteCommandLines, response_ptr), - base::BindOnce(callback, std::move(response))); + base::BindOnce(std::move(callback), std::move(response))); } } // namespace system_logs
diff --git a/chrome/browser/chromeos/system_logs/command_line_log_source.h b/chrome/browser/chromeos/system_logs/command_line_log_source.h index 374ac69..69fc07a 100644 --- a/chrome/browser/chromeos/system_logs/command_line_log_source.h +++ b/chrome/browser/chromeos/system_logs/command_line_log_source.h
@@ -18,7 +18,7 @@ ~CommandLineLogSource() override; // SystemLogsSource override. - void Fetch(const SysLogsSourceCallback& callback) override; + void Fetch(SysLogsSourceCallback callback) override; private: DISALLOW_COPY_AND_ASSIGN(CommandLineLogSource);
diff --git a/chrome/browser/chromeos/system_logs/dbus_log_source.cc b/chrome/browser/chromeos/system_logs/dbus_log_source.cc index 11a342fe..1308d251 100644 --- a/chrome/browser/chromeos/system_logs/dbus_log_source.cc +++ b/chrome/browser/chromeos/system_logs/dbus_log_source.cc
@@ -20,7 +20,7 @@ DBusLogSource::~DBusLogSource() { } -void DBusLogSource::Fetch(const SysLogsSourceCallback& callback) { +void DBusLogSource::Fetch(SysLogsSourceCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(!callback.is_null()); @@ -31,7 +31,7 @@ response->emplace(kDBusLogEntryLong, dbus::statistics::GetAsString( dbus::statistics::SHOW_METHOD, dbus::statistics::FORMAT_TOTALS)); - callback.Run(std::move(response)); + std::move(callback).Run(std::move(response)); } } // namespace system_logs
diff --git a/chrome/browser/chromeos/system_logs/dbus_log_source.h b/chrome/browser/chromeos/system_logs/dbus_log_source.h index a80140e..5242d6f 100644 --- a/chrome/browser/chromeos/system_logs/dbus_log_source.h +++ b/chrome/browser/chromeos/system_logs/dbus_log_source.h
@@ -17,7 +17,7 @@ ~DBusLogSource() override; // SystemLogsSource override. - void Fetch(const SysLogsSourceCallback& request) override; + void Fetch(SysLogsSourceCallback request) override; private: DISALLOW_COPY_AND_ASSIGN(DBusLogSource);
diff --git a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc index f5205373d..6b272e4 100644 --- a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc +++ b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc
@@ -42,12 +42,12 @@ DebugDaemonLogSource::~DebugDaemonLogSource() {} -void DebugDaemonLogSource::Fetch(const SysLogsSourceCallback& callback) { +void DebugDaemonLogSource::Fetch(SysLogsSourceCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(!callback.is_null()); DCHECK(callback_.is_null()); - callback_ = callback; + callback_ = std::move(callback); chromeos::DebugDaemonClient* client = chromeos::DBusThreadManager::Get()->GetDebugDaemonClient(); @@ -153,7 +153,8 @@ (*response_)[kUserLogFileKeyName] = kNotAvailable; auto response = std::make_unique<SystemLogsResponse>(); std::swap(response, response_); - callback_.Run(std::move(response)); + DCHECK(!callback_.is_null()); + std::move(callback_).Run(std::move(response)); } } @@ -186,7 +187,8 @@ response_->insert(response->begin(), response->end()); auto response_to_return = std::make_unique<SystemLogsResponse>(); std::swap(response_to_return, response_); - callback_.Run(std::move(response_to_return)); + DCHECK(!callback_.is_null()); + std::move(callback_).Run(std::move(response_to_return)); } void DebugDaemonLogSource::RequestCompleted() {
diff --git a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h index fd9b2cd..2c04d86b 100644 --- a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h +++ b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h
@@ -28,7 +28,7 @@ // Fetches logs from the daemon over dbus. After the fetch is complete, the // results will be forwarded to the request supplied to the constructor and // this instance will free itself. - void Fetch(const SysLogsSourceCallback& callback) override; + void Fetch(SysLogsSourceCallback callback) override; private: typedef std::map<std::string, std::string> KeyValueMap;
diff --git a/chrome/browser/chromeos/system_logs/device_event_log_source.cc b/chrome/browser/chromeos/system_logs/device_event_log_source.cc index d361000..fe60f56 100644 --- a/chrome/browser/chromeos/system_logs/device_event_log_source.cc +++ b/chrome/browser/chromeos/system_logs/device_event_log_source.cc
@@ -19,7 +19,7 @@ DeviceEventLogSource::~DeviceEventLogSource() { } -void DeviceEventLogSource::Fetch(const SysLogsSourceCallback& callback) { +void DeviceEventLogSource::Fetch(SysLogsSourceCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(!callback.is_null()); @@ -31,7 +31,7 @@ (*response)[kDeviceEventLogEntry] = device_event_log::GetAsString( device_event_log::OLDEST_FIRST, "time,file,type,level", "non-network", device_event_log::LOG_LEVEL_DEBUG, kMaxDeviceEventsForAboutSystem); - callback.Run(std::move(response)); + std::move(callback).Run(std::move(response)); } } // namespace system_logs
diff --git a/chrome/browser/chromeos/system_logs/device_event_log_source.h b/chrome/browser/chromeos/system_logs/device_event_log_source.h index a3d8eb6..6b21f5f 100644 --- a/chrome/browser/chromeos/system_logs/device_event_log_source.h +++ b/chrome/browser/chromeos/system_logs/device_event_log_source.h
@@ -17,7 +17,7 @@ ~DeviceEventLogSource() override; // SystemLogsSource override. - void Fetch(const SysLogsSourceCallback& request) override; + void Fetch(SysLogsSourceCallback request) override; private: DISALLOW_COPY_AND_ASSIGN(DeviceEventLogSource);
diff --git a/chrome/browser/chromeos/system_logs/lsb_release_log_source.cc b/chrome/browser/chromeos/system_logs/lsb_release_log_source.cc index d1103ab..4c0bd50 100644 --- a/chrome/browser/chromeos/system_logs/lsb_release_log_source.cc +++ b/chrome/browser/chromeos/system_logs/lsb_release_log_source.cc
@@ -16,7 +16,7 @@ LsbReleaseLogSource::~LsbReleaseLogSource() { } -void LsbReleaseLogSource::Fetch(const SysLogsSourceCallback& callback) { +void LsbReleaseLogSource::Fetch(SysLogsSourceCallback callback) { DCHECK(!callback.is_null()); auto response = std::make_unique<SystemLogsResponse>(); const base::SysInfo::LsbReleaseMap& lsb_map = @@ -25,7 +25,7 @@ iter != lsb_map.end(); ++iter) { (*response)[iter->first] = iter->second; } - callback.Run(std::move(response)); + std::move(callback).Run(std::move(response)); } } // namespace system_logs
diff --git a/chrome/browser/chromeos/system_logs/lsb_release_log_source.h b/chrome/browser/chromeos/system_logs/lsb_release_log_source.h index bfd39b4b..df9aa40 100644 --- a/chrome/browser/chromeos/system_logs/lsb_release_log_source.h +++ b/chrome/browser/chromeos/system_logs/lsb_release_log_source.h
@@ -16,7 +16,7 @@ ~LsbReleaseLogSource() override; // SystemLogsSource override. - void Fetch(const SysLogsSourceCallback& callback) override; + void Fetch(SysLogsSourceCallback callback) override; private: DISALLOW_COPY_AND_ASSIGN(LsbReleaseLogSource);
diff --git a/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.cc b/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.cc index aaf7e7eb..f9c0518 100644 --- a/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.cc +++ b/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.cc
@@ -43,22 +43,22 @@ SingleDebugDaemonLogSource::~SingleDebugDaemonLogSource() {} -void SingleDebugDaemonLogSource::Fetch(const SysLogsSourceCallback& callback) { +void SingleDebugDaemonLogSource::Fetch(SysLogsSourceCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(!callback.is_null()); chromeos::DebugDaemonClient* client = chromeos::DBusThreadManager::Get()->GetDebugDaemonClient(); - client->GetLog( - source_name(), - base::BindOnce(&SingleDebugDaemonLogSource::OnFetchComplete, - weak_ptr_factory_.GetWeakPtr(), source_name(), callback)); + client->GetLog(source_name(), + base::BindOnce(&SingleDebugDaemonLogSource::OnFetchComplete, + weak_ptr_factory_.GetWeakPtr(), source_name(), + std::move(callback))); } void SingleDebugDaemonLogSource::OnFetchComplete( const std::string& log_name, - const SysLogsSourceCallback& callback, + SysLogsSourceCallback callback, base::Optional<std::string> result) const { // |result| and |response| are the same type, but |result| is passed in from // DebugDaemonClient, which does not use the SystemLogsResponse alias. @@ -67,7 +67,7 @@ if (result.has_value()) response->emplace(log_name, result.value()); - callback.Run(std::move(response)); + std::move(callback).Run(std::move(response)); } } // namespace system_logs
diff --git a/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.h b/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.h index 0d02ea6f..f30af19 100644 --- a/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.h +++ b/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.h
@@ -40,12 +40,12 @@ ~SingleDebugDaemonLogSource() override; // system_logs::SystemLogsSource: - void Fetch(const SysLogsSourceCallback& callback) override; + void Fetch(SysLogsSourceCallback callback) override; private: // Callback for handling response from DebugDaemonClient. void OnFetchComplete(const std::string& log_name, - const SysLogsSourceCallback& callback, + SysLogsSourceCallback callback, base::Optional<std::string> result) const; base::WeakPtrFactory<SingleDebugDaemonLogSource> weak_ptr_factory_;
diff --git a/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source_unittest.cc b/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source_unittest.cc index 1f7bd8b..23be74e 100644 --- a/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source_unittest.cc +++ b/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source_unittest.cc
@@ -26,9 +26,6 @@ SingleDebugDaemonLogSourceTest() : scoped_task_environment_( base::test::ScopedTaskEnvironment::MainThreadType::UI), - fetch_callback_( - base::Bind(&SingleDebugDaemonLogSourceTest::OnFetchComplete, - base::Unretained(this))), num_callback_calls_(0) {} void SetUp() override { @@ -44,8 +41,9 @@ } protected: - const SysLogsSourceCallback& fetch_callback() const { - return fetch_callback_; + SysLogsSourceCallback fetch_callback() { + return base::BindOnce(&SingleDebugDaemonLogSourceTest::OnFetchComplete, + base::Unretained(this)); } int num_callback_calls() const { return num_callback_calls_; } @@ -67,10 +65,6 @@ // |scoped_task_environment_| in order to use the MessageLoop it created. content::TestBrowserThreadBundle browser_thread_bundle_; - // Pre-made callback object for passing OnFetchComplete() to an asynchronous - // function. - const SysLogsSourceCallback fetch_callback_; - // Used to verify that OnFetchComplete was called the correct number of times. int num_callback_calls_;
diff --git a/chrome/browser/chromeos/system_logs/single_log_file_log_source.cc b/chrome/browser/chromeos/system_logs/single_log_file_log_source.cc index 84e92bdc..1f5186c 100644 --- a/chrome/browser/chromeos/system_logs/single_log_file_log_source.cc +++ b/chrome/browser/chromeos/system_logs/single_log_file_log_source.cc
@@ -93,7 +93,7 @@ g_chrome_start_time_for_test = start_time; } -void SingleLogFileLogSource::Fetch(const SysLogsSourceCallback& callback) { +void SingleLogFileLogSource::Fetch(SysLogsSourceCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(!callback.is_null()); @@ -105,7 +105,7 @@ base::BindOnce(&SingleLogFileLogSource::ReadFile, weak_ptr_factory_.GetWeakPtr(), kMaxNumAllowedLogRotationsDuringFileRead, response_ptr), - base::BindOnce(callback, std::move(response))); + base::BindOnce(std::move(callback), std::move(response))); } base::FilePath SingleLogFileLogSource::GetLogFilePath() const {
diff --git a/chrome/browser/chromeos/system_logs/single_log_file_log_source.h b/chrome/browser/chromeos/system_logs/single_log_file_log_source.h index 2a1c22ff..449c0c0 100644 --- a/chrome/browser/chromeos/system_logs/single_log_file_log_source.h +++ b/chrome/browser/chromeos/system_logs/single_log_file_log_source.h
@@ -57,7 +57,7 @@ static void SetChromeStartTimeForTesting(const base::Time* start_time); // system_logs::SystemLogsSource: - void Fetch(const SysLogsSourceCallback& callback) override; + void Fetch(SysLogsSourceCallback callback) override; private: friend class SingleLogFileLogSourceTest;
diff --git a/chrome/browser/chromeos/system_logs/touch_log_source.h b/chrome/browser/chromeos/system_logs/touch_log_source.h index e2efaeee..58763490 100644 --- a/chrome/browser/chromeos/system_logs/touch_log_source.h +++ b/chrome/browser/chromeos/system_logs/touch_log_source.h
@@ -17,7 +17,7 @@ private: // Overridden from SystemLogsSource: - void Fetch(const SysLogsSourceCallback& callback) override; + void Fetch(SysLogsSourceCallback callback) override; DISALLOW_COPY_AND_ASSIGN(TouchLogSource); };
diff --git a/chrome/browser/chromeos/system_logs/touch_log_source_ozone.cc b/chrome/browser/chromeos/system_logs/touch_log_source_ozone.cc index 722ea5f..fe9cac7 100644 --- a/chrome/browser/chromeos/system_logs/touch_log_source_ozone.cc +++ b/chrome/browser/chromeos/system_logs/touch_log_source_ozone.cc
@@ -136,7 +136,7 @@ // This is the end of the whole touch log collection process. void OnEventLogCollected( std::unique_ptr<system_logs::SystemLogsResponse> response, - const system_logs::SysLogsSourceCallback& callback, + system_logs::SysLogsSourceCallback callback, const std::vector<base::FilePath>& log_paths) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -144,7 +144,7 @@ base::PostTaskWithTraitsAndReply( FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, base::BindOnce(&PackEventLog, response_ptr, log_paths), - base::BindOnce(callback, std::move(response))); + base::BindOnce(std::move(callback), std::move(response))); } // Callback for handing the outcome of GetTouchDeviceStatus(). @@ -153,7 +153,7 @@ // collect touch event logs. void OnStatusLogCollected( std::unique_ptr<system_logs::SystemLogsResponse> response, - const system_logs::SysLogsSourceCallback& callback, + system_logs::SysLogsSourceCallback callback, const std::string& log) { DCHECK_CURRENTLY_ON(BrowserThread::UI); (*response)[kDeviceStatusLogDataKey] = log; @@ -163,8 +163,8 @@ ui::InputDeviceControllerClient* input_device_controller_client = g_browser_process->platform_part()->GetInputDeviceControllerClient(); input_device_controller_client->GetTouchEventLog( - kBaseLogPath, - base::BindOnce(&OnEventLogCollected, std::move(response), callback)); + kBaseLogPath, base::BindOnce(&OnEventLogCollected, std::move(response), + std::move(callback))); } // Collect touch HUD debug logs. This needs to be done on the UI thread. @@ -184,7 +184,7 @@ namespace system_logs { -void TouchLogSource::Fetch(const SysLogsSourceCallback& callback) { +void TouchLogSource::Fetch(SysLogsSourceCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(!callback.is_null()); @@ -194,8 +194,8 @@ // Collect touch device status logs. ui::InputDeviceControllerClient* input_device_controller_client = g_browser_process->platform_part()->GetInputDeviceControllerClient(); - input_device_controller_client->GetTouchDeviceStatus( - base::BindOnce(&OnStatusLogCollected, std::move(response), callback)); + input_device_controller_client->GetTouchDeviceStatus(base::BindOnce( + &OnStatusLogCollected, std::move(response), std::move(callback))); } } // namespace system_logs
diff --git a/chrome/browser/component_updater/component_updater_utils.cc b/chrome/browser/component_updater/component_updater_utils.cc index 7da8bdb..97368e1 100644 --- a/chrome/browser/component_updater/component_updater_utils.cc +++ b/chrome/browser/component_updater/component_updater_utils.cc
@@ -13,6 +13,8 @@ bool IsPerUserInstall() { #if defined(OS_WIN) + // The installer computes and caches this value in memory during the + // process start up. return InstallUtil::IsPerUserInstall(); #else return true;
diff --git a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc index ff39e3e..e3a222a 100644 --- a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc +++ b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
@@ -111,7 +111,7 @@ ChromeInternalLogSource::~ChromeInternalLogSource() { } -void ChromeInternalLogSource::Fetch(const SysLogsSourceCallback& callback) { +void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(!callback.is_null()); @@ -156,10 +156,10 @@ base::PostTaskWithTraitsAndReply( FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, base::BindOnce(&GetEntriesAsync, response_ptr), - base::BindOnce(callback, std::move(response))); + base::BindOnce(std::move(callback), std::move(response))); #else // On other platforms, we're done. Invoke the callback. - callback.Run(std::move(response)); + std::move(callback).Run(std::move(response)); #endif // defined(OS_CHROMEOS) }
diff --git a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h index 5d33b844..44758a280 100644 --- a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h +++ b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h
@@ -18,7 +18,7 @@ ~ChromeInternalLogSource() override; // SystemLogsSource override. - void Fetch(const SysLogsSourceCallback& request) override; + void Fetch(SysLogsSourceCallback request) override; private: void PopulateSyncLogs(SystemLogsResponse* response);
diff --git a/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.cc b/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.cc index 43bbcd6..32204cdbd 100644 --- a/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.cc +++ b/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.cc
@@ -33,10 +33,11 @@ CrashIdsSource::~CrashIdsSource() {} -void CrashIdsSource::Fetch(const SysLogsSourceCallback& callback) { +void CrashIdsSource::Fetch(SysLogsSourceCallback callback) { // Unretained since we own these callbacks. - pending_requests_.emplace_back(base::Bind( - &CrashIdsSource::RespondWithCrashIds, base::Unretained(this), callback)); + pending_requests_.emplace_back( + base::BindOnce(&CrashIdsSource::RespondWithCrashIds, + base::Unretained(this), std::move(callback))); if (pending_crash_list_loading_) return; @@ -70,19 +71,18 @@ } } - for (const auto& request : pending_requests_) - request.Run(); + for (auto& request : pending_requests_) + std::move(request).Run(); pending_requests_.clear(); } -void CrashIdsSource::RespondWithCrashIds( - const SysLogsSourceCallback& callback) const { +void CrashIdsSource::RespondWithCrashIds(SysLogsSourceCallback callback) const { auto response = std::make_unique<SystemLogsResponse>(); (*response)[feedback::FeedbackReport::kCrashReportIdsKey] = crash_ids_list_; // We must respond anyways. - callback.Run(std::move(response)); + std::move(callback).Run(std::move(response)); } } // namespace system_logs
diff --git a/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h b/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h index 5193bf5..8da0956 100644 --- a/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h +++ b/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h
@@ -20,11 +20,11 @@ ~CrashIdsSource() override; // SystemLogsSource: - void Fetch(const SysLogsSourceCallback& callback) override; + void Fetch(SysLogsSourceCallback callback) override; private: void OnUploadListAvailable(); - void RespondWithCrashIds(const SysLogsSourceCallback& callback) const; + void RespondWithCrashIds(SysLogsSourceCallback callback) const; scoped_refptr<UploadList> crash_upload_list_; @@ -33,7 +33,7 @@ // Contains any pending fetch requests waiting for the crash upload list to // finish loading. - std::vector<base::Closure> pending_requests_; + std::vector<base::OnceClosure> pending_requests_; // True if the crash list is currently being loaded. bool pending_crash_list_loading_;
diff --git a/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.cc b/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.cc index 3e8f0df9..3ac651b6 100644 --- a/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.cc +++ b/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.cc
@@ -13,8 +13,8 @@ // Reads Chrome memory usage. class SystemLogsMemoryHandler : public MemoryDetails { public: - explicit SystemLogsMemoryHandler(const SysLogsSourceCallback& callback) - : callback_(callback) {} + explicit SystemLogsMemoryHandler(SysLogsSourceCallback callback) + : callback_(std::move(callback)) {} // Sends the data to the callback. // MemoryDetails override. @@ -23,7 +23,8 @@ auto response = std::make_unique<SystemLogsResponse>(); (*response)["mem_usage"] = ToLogString(); - callback_.Run(std::move(response)); + DCHECK(!callback_.is_null()); + std::move(callback_).Run(std::move(response)); } private: @@ -40,12 +41,12 @@ MemoryDetailsLogSource::~MemoryDetailsLogSource() { } -void MemoryDetailsLogSource::Fetch(const SysLogsSourceCallback& callback) { +void MemoryDetailsLogSource::Fetch(SysLogsSourceCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(!callback.is_null()); - scoped_refptr<SystemLogsMemoryHandler> - handler(new SystemLogsMemoryHandler(callback)); + scoped_refptr<SystemLogsMemoryHandler> handler( + new SystemLogsMemoryHandler(std::move(callback))); handler->StartFetch(); }
diff --git a/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h b/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h index 7edd90f..d0de608 100644 --- a/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h +++ b/chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h
@@ -17,7 +17,7 @@ ~MemoryDetailsLogSource() override; // SystemLogsSource override. - void Fetch(const SysLogsSourceCallback& request) override; + void Fetch(SysLogsSourceCallback request) override; private: DISALLOW_COPY_AND_ASSIGN(MemoryDetailsLogSource);
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc index 919c1c9..ce8c62c8 100644 --- a/chrome/browser/printing/print_job.cc +++ b/chrome/browser/printing/print_job.cc
@@ -77,6 +77,14 @@ new_doc->set_page_count(page_count); UpdatePrintedDocument(new_doc); +#if defined(OS_WIN) + pdf_page_mapping_ = PageRange::GetPages(settings_.ranges()); + if (pdf_page_mapping_.empty()) { + for (int i = 0; i < page_count; i++) + pdf_page_mapping_.push_back(i); + } +#endif + // Don't forget to register to our own messages. registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT, content::Source<PrintJob>(this)); @@ -253,10 +261,6 @@ std::unique_ptr<PdfConverter> converter_; }; -void PrintJob::AppendPrintedPage(int page_number) { - pdf_page_mapping_.push_back(page_number); -} - void PrintJob::StartPdfToEmfConversion( const scoped_refptr<base::RefCountedMemory>& bytes, const gfx::Size& page_size,
diff --git a/chrome/browser/printing/print_job.h b/chrome/browser/printing/print_job.h index 9b57e52..df73274 100644 --- a/chrome/browser/printing/print_job.h +++ b/chrome/browser/printing/print_job.h
@@ -89,9 +89,6 @@ PrintedDocument* document() const; #if defined(OS_WIN) - // Let the PrintJob know the 0-based |page_number| of a given printed page. - void AppendPrintedPage(int page_number); - void StartPdfToEmfConversion( const scoped_refptr<base::RefCountedMemory>& bytes, const gfx::Size& page_size,
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc index ea85666..a3598d8 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -81,7 +81,6 @@ printing_rfh_(nullptr), printing_succeeded_(false), inside_inner_message_loop_(false), - expecting_first_page_(true), queue_(g_browser_process->print_job_manager()->queue()), weak_ptr_factory_(this) { DCHECK(queue_.get()); @@ -133,7 +132,7 @@ } void PrintViewManagerBase::OnComposePdfDone( - const PrintHostMsg_DidPrintPage_Params& params, + const PrintHostMsg_DidPrintDocument_Params& params, mojom::PdfCompositor::Status status, mojo::ScopedSharedBufferHandle handle) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -142,17 +141,11 @@ return; } - UpdateForPrintedPage(params, true, GetShmFromMojoHandle(std::move(handle))); + UpdateForPrintedDocument(params, GetShmFromMojoHandle(std::move(handle))); } -void PrintViewManagerBase::OnDidPrintPage( - const PrintHostMsg_DidPrintPage_Params& params) { -// TODO(rbpotter): Remove this check once there are no more spurious -// DidPrintPage messages. -#if !defined(OS_WIN) - if (!expecting_first_page_) - return; -#endif +void PrintViewManagerBase::OnDidPrintDocument( + const PrintHostMsg_DidPrintDocument_Params& params) { // Ready to composite. Starting a print job. if (!OpportunisticallyCreatePrintJob(params.document_cookie)) return; @@ -164,96 +157,77 @@ return; } - const bool metafile_must_be_valid = expecting_first_page_; - expecting_first_page_ = false; - - // Only used when |metafile_must_be_valid| is true. - std::unique_ptr<base::SharedMemory> shared_buf; - if (metafile_must_be_valid) { - if (!base::SharedMemory::IsHandleValid(params.metafile_data_handle)) { - NOTREACHED() << "invalid memory handle"; - web_contents()->Stop(); - return; - } - - auto* client = PrintCompositeClient::FromWebContents(web_contents()); - if (IsOopifEnabled() && !client->for_preview() && - !document->settings().is_modifiable()) { - client->DoComposite( - params.metafile_data_handle, params.data_size, - base::BindOnce(&PrintViewManagerBase::OnComposePdfDone, - weak_ptr_factory_.GetWeakPtr(), params)); - return; - } - shared_buf = - std::make_unique<base::SharedMemory>(params.metafile_data_handle, true); - if (!shared_buf->Map(params.data_size)) { - NOTREACHED() << "couldn't map"; - web_contents()->Stop(); - return; - } - } else { - if (base::SharedMemory::IsHandleValid(params.metafile_data_handle)) { - NOTREACHED() << "unexpected valid memory handle"; - web_contents()->Stop(); - base::SharedMemory::CloseHandle(params.metafile_data_handle); - return; - } + if (!base::SharedMemory::IsHandleValid(params.metafile_data_handle)) { + NOTREACHED() << "invalid memory handle"; + web_contents()->Stop(); + return; } - UpdateForPrintedPage(params, metafile_must_be_valid, std::move(shared_buf)); + auto* client = PrintCompositeClient::FromWebContents(web_contents()); + if (IsOopifEnabled() && !client->for_preview() && + !document->settings().is_modifiable()) { + client->DoComposite(params.metafile_data_handle, params.data_size, + base::BindOnce(&PrintViewManagerBase::OnComposePdfDone, + weak_ptr_factory_.GetWeakPtr(), params)); + return; + } + + std::unique_ptr<base::SharedMemory> shared_buf = + std::make_unique<base::SharedMemory>(params.metafile_data_handle, true); + if (!shared_buf->Map(params.data_size)) { + NOTREACHED() << "couldn't map"; + web_contents()->Stop(); + return; + } + + UpdateForPrintedDocument(params, std::move(shared_buf)); } -void PrintViewManagerBase::UpdateForPrintedPage( - const PrintHostMsg_DidPrintPage_Params& params, - bool has_valid_page_data, +void PrintViewManagerBase::UpdateForPrintedDocument( + const PrintHostMsg_DidPrintDocument_Params& params, std::unique_ptr<base::SharedMemory> shared_buf) { PrintedDocument* document = print_job_->document(); if (!document) return; #if defined(OS_WIN) - print_job_->AppendPrintedPage(params.page_number); - if (has_valid_page_data) { - scoped_refptr<base::RefCountedBytes> bytes(new base::RefCountedBytes( - reinterpret_cast<const unsigned char*>(shared_buf->memory()), - shared_buf->mapped_size())); + scoped_refptr<base::RefCountedBytes> bytes = + base::MakeRefCounted<base::RefCountedBytes>( + reinterpret_cast<const unsigned char*>(shared_buf->memory()), + shared_buf->mapped_size()); - if (PrintedDocument::HasDebugDumpPath()) - document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf")); + if (PrintedDocument::HasDebugDumpPath()) + document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf")); - const auto& settings = document->settings(); - if (settings.printer_is_textonly()) { - print_job_->StartPdfToTextConversion(bytes, params.page_size); - } else if ((settings.printer_is_ps2() || settings.printer_is_ps3()) && - !base::FeatureList::IsEnabled( - features::kDisablePostScriptPrinting)) { - print_job_->StartPdfToPostScriptConversion(bytes, params.content_area, - params.physical_offsets, - settings.printer_is_ps2()); - } else { - // TODO(thestig): Figure out why rendering text with GDI results in random - // missing characters for some users. https://crbug.com/658606 - // Update : The missing letters seem to have been caused by the same - // problem as https://crbug.com/659604 which was resolved. GDI printing - // seems to work with the fix for this bug applied. - bool print_text_with_gdi = - settings.print_text_with_gdi() && !settings.printer_is_xps() && - base::FeatureList::IsEnabled(features::kGdiTextPrinting); - print_job_->StartPdfToEmfConversion( - bytes, params.page_size, params.content_area, print_text_with_gdi); - } + const auto& settings = document->settings(); + if (settings.printer_is_textonly()) { + print_job_->StartPdfToTextConversion(bytes, params.page_size); + } else if ((settings.printer_is_ps2() || settings.printer_is_ps3()) && + !base::FeatureList::IsEnabled( + features::kDisablePostScriptPrinting)) { + print_job_->StartPdfToPostScriptConversion(bytes, params.content_area, + params.physical_offsets, + settings.printer_is_ps2()); + } else { + // TODO(thestig): Figure out why rendering text with GDI results in random + // missing characters for some users. https://crbug.com/658606 + // Update : The missing letters seem to have been caused by the same + // problem as https://crbug.com/659604 which was resolved. GDI printing + // seems to work with the fix for this bug applied. + bool print_text_with_gdi = + settings.print_text_with_gdi() && !settings.printer_is_xps() && + base::FeatureList::IsEnabled(features::kGdiTextPrinting); + print_job_->StartPdfToEmfConversion( + bytes, params.page_size, params.content_area, print_text_with_gdi); } #else std::unique_ptr<PdfMetafileSkia> metafile = std::make_unique<PdfMetafileSkia>(SkiaDocumentType::PDF); - if (has_valid_page_data) { - if (!metafile->InitFromData(shared_buf->memory(), - shared_buf->mapped_size())) { - NOTREACHED() << "Invalid metafile header"; - web_contents()->Stop(); - return; - } + if (!metafile->InitFromData(shared_buf->memory(), + shared_buf->mapped_size())) { + NOTREACHED() << "Invalid metafile header"; + web_contents()->Stop(); + return; } // Update the rendered document. It will send notifications to the listener. @@ -331,7 +305,7 @@ content::RenderFrameHost* render_frame_host) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(PrintViewManagerBase, message) - IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintPage, OnDidPrintPage) + IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintDocument, OnDidPrintDocument) IPC_MESSAGE_HANDLER(PrintHostMsg_ShowInvalidPrinterSettingsError, OnShowInvalidPrinterSettingsError) IPC_MESSAGE_UNHANDLED(handled = false) @@ -422,7 +396,7 @@ // PrintJob will send a ALL_PAGES_REQUESTED after having received all the // pages it needs. RunLoop::QuitCurrentWhenIdleDeprecated() will be called as // soon as print_job_->document()->IsComplete() is true on either - // ALL_PAGES_REQUESTED or in DidPrintPage(). The check is done in + // ALL_PAGES_REQUESTED or in DidPrintDocument(). The check is done in // ShouldQuitFromInnerMessageLoop(). // BLOCKS until all the pages are received. (Need to enable recursive task) if (!RunInnerMessageLoop()) { @@ -489,7 +463,6 @@ // DO NOT wait for the job to finish. ReleasePrintJob(); } - expecting_first_page_ = true; } void PrintViewManagerBase::TerminatePrintJob(bool cancel) {
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h index 3860074..870e87f 100644 --- a/chrome/browser/printing/print_view_manager_base.h +++ b/chrome/browser/printing/print_view_manager_base.h
@@ -20,7 +20,7 @@ #include "mojo/public/cpp/system/platform_handle.h" #include "printing/features/features.h" -struct PrintHostMsg_DidPrintPage_Params; +struct PrintHostMsg_DidPrintDocument_Params; namespace base { class SharedMemory; @@ -91,15 +91,15 @@ void OnDidGetPrintedPagesCount(int cookie, int number_pages) override; void OnPrintingFailed(int cookie) override; void OnShowInvalidPrinterSettingsError(); - void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params); + void OnDidPrintDocument(const PrintHostMsg_DidPrintDocument_Params& params); - // Handle extra tasks once a page or doc is printed. - void UpdateForPrintedPage(const PrintHostMsg_DidPrintPage_Params& params, - bool has_valid_page_data, - std::unique_ptr<base::SharedMemory> shared_buf); + // Handle extra tasks once the document is printed. + void UpdateForPrintedDocument( + const PrintHostMsg_DidPrintDocument_Params& params, + std::unique_ptr<base::SharedMemory> shared_buf); // IPC message handlers for service. - void OnComposePdfDone(const PrintHostMsg_DidPrintPage_Params& params, + void OnComposePdfDone(const PrintHostMsg_DidPrintDocument_Params& params, mojom::PdfCompositor::Status status, mojo::ScopedSharedBufferHandle handle); @@ -113,7 +113,7 @@ // Quits the current message loop if these conditions hold true: a document is // loaded and is complete and waiting_for_pages_to_be_rendered_ is true. This - // function is called in DidPrintPage() or on ALL_PAGES_REQUESTED + // function is called in DidPrintDocument() or on ALL_PAGES_REQUESTED // notification. The inner message loop is created was created by // RenderAllMissingPagesNow(). void ShouldQuitFromInnerMessageLoop(); @@ -170,9 +170,6 @@ // print settings are being loaded. bool inside_inner_message_loop_; - // Set to true when OnDidPrintPage() should be expecting the first page. - bool expecting_first_page_; - // Whether printing is enabled. BooleanPrefMember printing_enabled_;
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc index 77a46c7..35a1dcef7 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
@@ -14,7 +14,7 @@ namespace resource_coordinator { -TabLifecycleUnit::TabLifecycleUnit( +TabLifecycleUnitSource::TabLifecycleUnit::TabLifecycleUnit( base::ObserverList<TabLifecycleObserver>* observers, content::WebContents* web_contents, TabStripModel* tab_strip_model) @@ -26,19 +26,21 @@ DCHECK(tab_strip_model_); } -TabLifecycleUnit::~TabLifecycleUnit() = default; +TabLifecycleUnitSource::TabLifecycleUnit::~TabLifecycleUnit() = default; -void TabLifecycleUnit::SetTabStripModel(TabStripModel* tab_strip_model) { +void TabLifecycleUnitSource::TabLifecycleUnit::SetTabStripModel( + TabStripModel* tab_strip_model) { DCHECK(tab_strip_model); tab_strip_model = tab_strip_model_; } -void TabLifecycleUnit::SetWebContents(content::WebContents* web_contents) { +void TabLifecycleUnitSource::TabLifecycleUnit::SetWebContents( + content::WebContents* web_contents) { DCHECK(web_contents); web_contents_ = web_contents; } -void TabLifecycleUnit::SetFocused(bool focused) { +void TabLifecycleUnitSource::TabLifecycleUnit::SetFocused(bool focused) { const bool was_focused = last_focused_time_ == base::TimeTicks::Max(); if (focused == was_focused) return; @@ -47,11 +49,11 @@ // TODO(fdoray): Reload the tab if discarded. https://crbug.com/775644 } -base::string16 TabLifecycleUnit::GetTitle() const { +base::string16 TabLifecycleUnitSource::TabLifecycleUnit::GetTitle() const { return GetWebContents()->GetTitle(); } -std::string TabLifecycleUnit::GetIconURL() const { +std::string TabLifecycleUnitSource::TabLifecycleUnit::GetIconURL() const { auto* last_committed_entry = GetWebContents()->GetController().GetLastCommittedEntry(); if (!last_committed_entry) @@ -60,38 +62,45 @@ return favicon.valid ? favicon.url.spec() : std::string(); } -LifecycleUnit::SortKey TabLifecycleUnit::GetSortKey() const { +LifecycleUnit::SortKey TabLifecycleUnitSource::TabLifecycleUnit::GetSortKey() + const { return SortKey(last_focused_time_); } -LifecycleUnit::State TabLifecycleUnit::GetState() const { +LifecycleUnit::State TabLifecycleUnitSource::TabLifecycleUnit::GetState() + const { return state_; } -int TabLifecycleUnit::GetEstimatedMemoryFreedOnDiscardKB() const { +int TabLifecycleUnitSource::TabLifecycleUnit:: + GetEstimatedMemoryFreedOnDiscardKB() const { // TODO(fdoray): Implement this. https://crbug.com/775644 return 0; } -bool TabLifecycleUnit::CanDiscard(DiscardReason reason) const { +bool TabLifecycleUnitSource::TabLifecycleUnit::CanDiscard( + DiscardReason reason) const { // TODO(fdoray): Implement this. https://crbug.com/775644 return false; } -bool TabLifecycleUnit::Discard(DiscardReason discard_reason) { +bool TabLifecycleUnitSource::TabLifecycleUnit::Discard( + DiscardReason discard_reason) { // TODO(fdoray): Implement this. https://crbug.com/775644 return false; } -content::WebContents* TabLifecycleUnit::GetWebContents() const { +content::WebContents* TabLifecycleUnitSource::TabLifecycleUnit::GetWebContents() + const { return web_contents_; } -bool TabLifecycleUnit::IsAutoDiscardable() const { +bool TabLifecycleUnitSource::TabLifecycleUnit::IsAutoDiscardable() const { return auto_discardable_; } -void TabLifecycleUnit::SetAutoDiscardable(bool auto_discardable) { +void TabLifecycleUnitSource::TabLifecycleUnit::SetAutoDiscardable( + bool auto_discardable) { if (auto_discardable_ == auto_discardable) return; auto_discardable_ = auto_discardable; @@ -99,11 +108,11 @@ observer.OnAutoDiscardableStateChange(GetWebContents(), auto_discardable_); } -void TabLifecycleUnit::DiscardTab() { +void TabLifecycleUnitSource::TabLifecycleUnit::DiscardTab() { Discard(DiscardReason::kExternal); } -bool TabLifecycleUnit::IsDiscarded() const { +bool TabLifecycleUnitSource::TabLifecycleUnit::IsDiscarded() const { return GetState() == State::DISCARDED; }
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit.h b/chrome/browser/resource_coordinator/tab_lifecycle_unit.h index 5c88a7b..00b629c 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit.h +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
@@ -10,6 +10,7 @@ #include "base/time/time.h" #include "chrome/browser/resource_coordinator/lifecycle_unit.h" #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" +#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h" class TabStripModel; @@ -22,7 +23,9 @@ class TabLifecycleObserver; // Represents a tab. -class TabLifecycleUnit : public LifecycleUnit, public TabLifecycleUnitExternal { +class TabLifecycleUnitSource::TabLifecycleUnit + : public LifecycleUnit, + public TabLifecycleUnitExternal { public: // |observers| is a list of observers to notify when the discarded state or // the auto-discardable state of this tab changes. It can be modified outside
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc index 37f5447..7992ea3 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc
@@ -4,13 +4,17 @@ #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" +#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h" + namespace resource_coordinator { // static TabLifecycleUnitExternal* TabLifecycleUnitExternal::FromWebContents( content::WebContents* web_contents) { - // TODO(fdoray): Implement this. https://crbug.com/775644 - return nullptr; + TabLifecycleUnitSource* source = TabLifecycleUnitSource::GetInstance(); + if (!source) + return nullptr; + return source->GetTabLifecycleUnitExternal(web_contents); } } // namespace resource_coordinator
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc new file mode 100644 index 0000000..b385ce9 --- /dev/null +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
@@ -0,0 +1,158 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h" + +#include "base/logging.h" +#include "base/stl_util.h" +#include "chrome/browser/resource_coordinator/lifecycle_unit_source_observer.h" +#include "chrome/browser/resource_coordinator/tab_lifecycle_unit.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_finder.h" +#include "chrome/browser/ui/browser_list.h" +#include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" + +namespace resource_coordinator { + +namespace { +TabLifecycleUnitSource* instance_ = nullptr; +} // namespace + +TabLifecycleUnitSource::TabLifecycleUnitSource() + : browser_tab_strip_tracker_(this, nullptr, this) { + DCHECK(!instance_); + DCHECK(BrowserList::GetInstance()->empty()); + browser_tab_strip_tracker_.Init(); + instance_ = this; +} + +TabLifecycleUnitSource::~TabLifecycleUnitSource() { + DCHECK_EQ(instance_, this); + instance_ = nullptr; +} + +// static +TabLifecycleUnitSource* TabLifecycleUnitSource::GetInstance() { + return instance_; +} + +TabLifecycleUnitExternal* TabLifecycleUnitSource::GetTabLifecycleUnitExternal( + content::WebContents* web_contents) const { + auto it = tabs_.find(web_contents); + if (it == tabs_.end()) + return nullptr; + return it->second.get(); +} + +void TabLifecycleUnitSource::AddTabLifecycleObserver( + TabLifecycleObserver* observer) { + tab_lifecycle_observers_.AddObserver(observer); +} + +void TabLifecycleUnitSource::RemoveTabLifecycleObserver( + TabLifecycleObserver* observer) { + tab_lifecycle_observers_.RemoveObserver(observer); +} + +void TabLifecycleUnitSource::SetFocusedTabStripModelForTesting( + TabStripModel* tab_strip) { + focused_tab_strip_model_for_testing_ = tab_strip; + UpdateFocusedTab(); +} + +TabStripModel* TabLifecycleUnitSource::GetFocusedTabStripModel() const { + if (focused_tab_strip_model_for_testing_) + return focused_tab_strip_model_for_testing_; + Browser* const focused_browser = chrome::FindBrowserWithActiveWindow(); + if (!focused_browser) + return nullptr; + return focused_browser->tab_strip_model(); +} + +void TabLifecycleUnitSource::UpdateFocusedTab() { + TabStripModel* const focused_tab_strip_model = GetFocusedTabStripModel(); + content::WebContents* const focused_web_contents = + focused_tab_strip_model ? focused_tab_strip_model->GetActiveWebContents() + : nullptr; + DCHECK(!focused_web_contents || + base::ContainsKey(tabs_, focused_web_contents)); + UpdateFocusedTabTo(focused_web_contents ? tabs_[focused_web_contents].get() + : nullptr); +} + +void TabLifecycleUnitSource::UpdateFocusedTabTo( + TabLifecycleUnit* new_focused_tab_lifecycle_unit) { + if (new_focused_tab_lifecycle_unit == focused_tab_lifecycle_unit_) + return; + if (focused_tab_lifecycle_unit_) + focused_tab_lifecycle_unit_->SetFocused(false); + if (new_focused_tab_lifecycle_unit) + new_focused_tab_lifecycle_unit->SetFocused(true); + focused_tab_lifecycle_unit_ = new_focused_tab_lifecycle_unit; +} + +void TabLifecycleUnitSource::TabInsertedAt(TabStripModel* tab_strip_model, + content::WebContents* contents, + int index, + bool foreground) { + auto it = tabs_.find(contents); + if (it == tabs_.end()) { + // A tab was created. + auto res = tabs_.insert(std::make_pair( + contents, std::make_unique<TabLifecycleUnit>( + &tab_lifecycle_observers_, contents, tab_strip_model))); + if (GetFocusedTabStripModel() == tab_strip_model && foreground) + UpdateFocusedTabTo(res.first->second.get()); + NotifyLifecycleUnitCreated(res.first->second.get()); + } else { + // A tab was moved to another window. + it->second->SetTabStripModel(tab_strip_model); + if (foreground) + UpdateFocusedTab(); + } +} + +void TabLifecycleUnitSource::TabClosingAt(TabStripModel* tab_strip_model, + content::WebContents* contents, + int index) { + auto it = tabs_.find(contents); + DCHECK(it != tabs_.end()); + TabLifecycleUnit* lifecycle_unit = it->second.get(); + if (focused_tab_lifecycle_unit_ == lifecycle_unit) + focused_tab_lifecycle_unit_ = nullptr; + NotifyLifecycleUnitDestroyed(lifecycle_unit); + tabs_.erase(contents); +} + +void TabLifecycleUnitSource::ActiveTabChanged( + content::WebContents* old_contents, + content::WebContents* new_contents, + int index, + int reason) { + UpdateFocusedTab(); +} + +void TabLifecycleUnitSource::TabReplacedAt(TabStripModel* tab_strip_model, + content::WebContents* old_contents, + content::WebContents* new_contents, + int index) { + DCHECK(!base::ContainsKey(tabs_, new_contents)); + auto it = tabs_.find(old_contents); + DCHECK(it != tabs_.end()); + std::unique_ptr<TabLifecycleUnit> lifecycle_unit = std::move(it->second); + lifecycle_unit->SetWebContents(new_contents); + tabs_.erase(it); + tabs_[new_contents] = std::move(lifecycle_unit); +} + +void TabLifecycleUnitSource::OnBrowserSetLastActive(Browser* browser) { + UpdateFocusedTab(); +} + +void TabLifecycleUnitSource::OnBrowserNoLongerActive(Browser* browser) { + UpdateFocusedTab(); +} + +} // namespace resource_coordinator
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h new file mode 100644 index 0000000..2f866a702 --- /dev/null +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
@@ -0,0 +1,113 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_LIFECYCLE_UNIT_SOURCE_H_ +#define CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_LIFECYCLE_UNIT_SOURCE_H_ + +#include <memory> + +#include "base/containers/flat_map.h" +#include "base/macros.h" +#include "base/observer_list.h" +#include "chrome/browser/resource_coordinator/lifecycle_unit_source_base.h" +#include "chrome/browser/ui/browser_list_observer.h" +#include "chrome/browser/ui/browser_tab_strip_tracker.h" +#include "chrome/browser/ui/tabs/tab_strip_model_observer.h" + +class TabStripModel; + +namespace content { +class WebContents; +} + +namespace resource_coordinator { + +class TabLifecycleObserver; +class TabLifecycleUnitExternal; + +// Creates and destroys LifecycleUnits as tabs are created and destroyed. +class TabLifecycleUnitSource : public BrowserListObserver, + public LifecycleUnitSourceBase, + public TabStripModelObserver { + public: + TabLifecycleUnitSource(); + ~TabLifecycleUnitSource() override; + + static TabLifecycleUnitSource* GetInstance(); + + // Returns the TabLifecycleUnitExternal instance associated with + // |web_contents|, or nullptr if |web_contents| isn't associated with a tab. + TabLifecycleUnitExternal* GetTabLifecycleUnitExternal( + content::WebContents* web_contents) const; + + // Adds / removes an observer that is notified when the discarded or auto- + // discardable state of a tab changes. + void AddTabLifecycleObserver(TabLifecycleObserver* observer); + void RemoveTabLifecycleObserver(TabLifecycleObserver* observer); + + // Pretend that |tab_strip| is the TabStripModel of the focused window. + void SetFocusedTabStripModelForTesting(TabStripModel* tab_strip); + + private: + friend class TabLifecycleUnitTest; + + class TabLifecycleUnit; + + // Returns the TabStripModel of the focused browser window, if any. + TabStripModel* GetFocusedTabStripModel() const; + + // Updates the focused TabLifecycleUnit. + void UpdateFocusedTab(); + + // Updates the focused TabLifecycleUnit to |new_focused_tab_lifecycle_unit|. + // TabInsertedAt() calls this directly instead of UpdateFocusedTab() because + // the active WebContents of a TabStripModel isn't updated when + // TabInsertedAt() is called. + void UpdateFocusedTabTo(TabLifecycleUnit* new_focused_tab_lifecycle_unit); + + // TabStripModelObserver: + void TabInsertedAt(TabStripModel* tab_strip_model, + content::WebContents* contents, + int index, + bool foreground) override; + void TabClosingAt(TabStripModel* tab_strip_model, + content::WebContents* contents, + int index) override; + void ActiveTabChanged(content::WebContents* old_contents, + content::WebContents* new_contents, + int index, + int reason) override; + void TabReplacedAt(TabStripModel* tab_strip_model, + content::WebContents* old_contents, + content::WebContents* new_contents, + int index) override; + + // BrowserListObserver: + void OnBrowserSetLastActive(Browser* browser) override; + void OnBrowserNoLongerActive(Browser* browser) override; + + // Tracks the BrowserList and all TabStripModels. + BrowserTabStripTracker browser_tab_strip_tracker_; + + // Pretend that this is the TabStripModel of the focused window, for testing. + TabStripModel* focused_tab_strip_model_for_testing_ = nullptr; + + // The currently focused TabLifecycleUnit. Updated by UpdateFocusedTab(). + TabLifecycleUnit* focused_tab_lifecycle_unit_ = nullptr; + + // Map from content::WebContents to TabLifecycleUnit. Should contain an entry + // for each tab in the current Chrome instance. + base::flat_map<content::WebContents*, std::unique_ptr<TabLifecycleUnit>> + tabs_; + + // Observers notified when the discarded or auto-discardable state of a tab + // changes. + base::ObserverList<TabLifecycleObserver> tab_lifecycle_observers_; + + DISALLOW_COPY_AND_ASSIGN(TabLifecycleUnitSource); +}; + +} // namespace resource_coordinator + +#endif // CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_LIFECYCLE_UNIT_SOURCE_H_
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc new file mode 100644 index 0000000..3d87b622 --- /dev/null +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
@@ -0,0 +1,254 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h" + +#include <memory> + +#include "base/macros.h" +#include "base/test/simple_test_tick_clock.h" +#include "chrome/browser/resource_coordinator/lifecycle_unit_source_observer.h" +#include "chrome/browser/resource_coordinator/tab_lifecycle_unit.h" +#include "chrome/browser/resource_coordinator/time.h" +#include "chrome/browser/ui/tabs/tab_strip_model_impl.h" +#include "chrome/browser/ui/tabs/test_tab_strip_model_delegate.h" +#include "chrome/test/base/chrome_render_view_host_test_harness.h" +#include "chrome/test/base/testing_profile.h" +#include "content/public/browser/web_contents.h" +#include "content/test/test_web_contents.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace resource_coordinator { + +namespace { + +constexpr base::TimeDelta kShortDelay = base::TimeDelta::FromSeconds(1); + +class NoUnloadListenerTabStripModelDelegate : public TestTabStripModelDelegate { + public: + NoUnloadListenerTabStripModelDelegate() = default; + bool RunUnloadListenerBeforeClosing(content::WebContents* contents) override { + // The default TestTabStripModelDelegate prevents tabs from being closed. + return false; + } + + private: + DISALLOW_COPY_AND_ASSIGN(NoUnloadListenerTabStripModelDelegate); +}; + +class MockLifecycleUnitSourceObserver : public LifecycleUnitSourceObserver { + public: + MockLifecycleUnitSourceObserver() = default; + + MOCK_METHOD1(OnLifecycleUnitCreated, void(LifecycleUnit*)); + MOCK_METHOD1(OnLifecycleUnitDestroyed, void(LifecycleUnit*)); + + private: + DISALLOW_COPY_AND_ASSIGN(MockLifecycleUnitSourceObserver); +}; + +bool IsFocused(LifecycleUnit* lifecycle_unit) { + return lifecycle_unit->GetSortKey().last_focused_time == + base::TimeTicks::Max(); +} + +bool WasNeverFocused(LifecycleUnit* lifecycle_unit) { + return lifecycle_unit->GetSortKey().last_focused_time.is_null(); +} + +class TabLifecycleUnitSourceTest : public ChromeRenderViewHostTestHarness { + protected: + TabLifecycleUnitSourceTest() + : scoped_set_tick_clock_for_testing_(&test_clock_) { + source_.AddObserver(&observer_); + } + + void SetUp() override { + ChromeRenderViewHostTestHarness::SetUp(); + tab_strip_model_ = std::make_unique<TabStripModelImpl>( + &tab_strip_model_delegate_, profile()); + tab_strip_model_->AddObserver(&source_); + } + + void TearDown() override { + tab_strip_model_.reset(); + ChromeRenderViewHostTestHarness::TearDown(); + } + + // If |focus_tab_strip| is true, focuses the tab strip. Then, appends 2 tabs + // to the tab strip and returns the associated LifecycleUnits via + // |first_lifecycle_unit| and |second_lifecycle_unit|. The first tab is + // background and the second tab is active. + void CreateTwoTabs(bool focus_tab_strip, + LifecycleUnit** first_lifecycle_unit, + LifecycleUnit** second_lifecycle_unit) { + if (focus_tab_strip) + source_.SetFocusedTabStripModelForTesting(tab_strip_model_.get()); + + // Add a foreground tab to the tab strip. + test_clock_.Advance(kShortDelay); + EXPECT_CALL(observer_, OnLifecycleUnitCreated(testing::_)) + .WillOnce(testing::Invoke([&](LifecycleUnit* lifecycle_unit) { + *first_lifecycle_unit = lifecycle_unit; + + if (focus_tab_strip) + EXPECT_TRUE(IsFocused(*first_lifecycle_unit)); + else + EXPECT_TRUE(WasNeverFocused(*first_lifecycle_unit)); + })); + content::WebContents* first_web_contents = CreateTestWebContents(); + tab_strip_model_->AppendWebContents(first_web_contents, true); + testing::Mock::VerifyAndClear(&observer_); + EXPECT_TRUE(source_.GetTabLifecycleUnitExternal(first_web_contents)); + + // Add another foreground tab to the focused tab strip. + test_clock_.Advance(kShortDelay); + auto time_before_second_tab = test_clock_.NowTicks(); + EXPECT_CALL(observer_, OnLifecycleUnitCreated(testing::_)) + .WillOnce(testing::Invoke([&](LifecycleUnit* lifecycle_unit) { + *second_lifecycle_unit = lifecycle_unit; + + if (focus_tab_strip) { + EXPECT_EQ(time_before_second_tab, + (*first_lifecycle_unit)->GetSortKey().last_focused_time); + EXPECT_TRUE(IsFocused(*second_lifecycle_unit)); + } else { + EXPECT_TRUE(WasNeverFocused(*first_lifecycle_unit)); + EXPECT_TRUE(WasNeverFocused(*second_lifecycle_unit)); + } + })); + content::WebContents* second_web_contents = CreateTestWebContents(); + tab_strip_model_->AppendWebContents(second_web_contents, true); + testing::Mock::VerifyAndClear(&observer_); + EXPECT_TRUE(source_.GetTabLifecycleUnitExternal(second_web_contents)); + } + + void TestAppendTabsToTabStrip(bool focus_tab_strip) { + LifecycleUnit* first_lifecycle_unit = nullptr; + LifecycleUnit* second_lifecycle_unit = nullptr; + CreateTwoTabs(focus_tab_strip, &first_lifecycle_unit, + &second_lifecycle_unit); + + const base::TimeTicks first_tab_last_focused_time = + first_lifecycle_unit->GetSortKey().last_focused_time; + + // Add a background tab to the focused tab strip. + test_clock_.Advance(kShortDelay); + LifecycleUnit* third_lifecycle_unit = nullptr; + EXPECT_CALL(observer_, OnLifecycleUnitCreated(testing::_)) + .WillOnce(testing::Invoke([&](LifecycleUnit* lifecycle_unit) { + third_lifecycle_unit = lifecycle_unit; + + if (focus_tab_strip) { + EXPECT_EQ(first_tab_last_focused_time, + first_lifecycle_unit->GetSortKey().last_focused_time); + EXPECT_TRUE(IsFocused(second_lifecycle_unit)); + } else { + EXPECT_TRUE(WasNeverFocused(first_lifecycle_unit)); + EXPECT_TRUE(WasNeverFocused(second_lifecycle_unit)); + } + EXPECT_TRUE(WasNeverFocused(third_lifecycle_unit)); + })); + content::WebContents* third_web_contents = CreateTestWebContents(); + tab_strip_model_->AppendWebContents(third_web_contents, false); + testing::Mock::VerifyAndClear(&observer_); + EXPECT_TRUE(source_.GetTabLifecycleUnitExternal(third_web_contents)); + + // Expect notifications when tabs are closed. + EXPECT_CALL(observer_, OnLifecycleUnitDestroyed(first_lifecycle_unit)); + EXPECT_CALL(observer_, OnLifecycleUnitDestroyed(second_lifecycle_unit)); + EXPECT_CALL(observer_, OnLifecycleUnitDestroyed(third_lifecycle_unit)); + tab_strip_model_->CloseAllTabs(); + } + + TabLifecycleUnitSource source_; + testing::StrictMock<MockLifecycleUnitSourceObserver> observer_; + std::unique_ptr<TabStripModel> tab_strip_model_; + base::SimpleTestTickClock test_clock_; + + private: + NoUnloadListenerTabStripModelDelegate tab_strip_model_delegate_; + ScopedSetTickClockForTesting scoped_set_tick_clock_for_testing_; + + DISALLOW_COPY_AND_ASSIGN(TabLifecycleUnitSourceTest); +}; + +} // namespace + +TEST_F(TabLifecycleUnitSourceTest, AppendTabsToFocusedTabStrip) { + TestAppendTabsToTabStrip(true /* focus_tab_strip */); +} + +TEST_F(TabLifecycleUnitSourceTest, AppendTabsToNonFocusedTabStrip) { + TestAppendTabsToTabStrip(false /* focus_tab_strip */); +} + +TEST_F(TabLifecycleUnitSourceTest, SwitchTabInFocusedTabStrip) { + LifecycleUnit* first_lifecycle_unit = nullptr; + LifecycleUnit* second_lifecycle_unit = nullptr; + CreateTwoTabs(true /* focus_tab_strip */, &first_lifecycle_unit, + &second_lifecycle_unit); + + // Activate the first tab. + test_clock_.Advance(kShortDelay); + auto time_before_activate = test_clock_.NowTicks(); + tab_strip_model_->ActivateTabAt(0, true); + EXPECT_TRUE(IsFocused(first_lifecycle_unit)); + EXPECT_EQ(time_before_activate, + second_lifecycle_unit->GetSortKey().last_focused_time); + + // Expect notifications when tabs are closed. + EXPECT_CALL(observer_, OnLifecycleUnitDestroyed(first_lifecycle_unit)); + EXPECT_CALL(observer_, OnLifecycleUnitDestroyed(second_lifecycle_unit)); + tab_strip_model_->CloseAllTabs(); +} + +TEST_F(TabLifecycleUnitSourceTest, CloseTabInFocusedTabStrip) { + LifecycleUnit* first_lifecycle_unit = nullptr; + LifecycleUnit* second_lifecycle_unit = nullptr; + CreateTwoTabs(true /* focus_tab_strip */, &first_lifecycle_unit, + &second_lifecycle_unit); + + // Close the second tab. The first tab should be focused. + test_clock_.Advance(kShortDelay); + EXPECT_CALL(observer_, OnLifecycleUnitDestroyed(second_lifecycle_unit)); + tab_strip_model_->CloseWebContentsAt(1, 0); + testing::Mock::VerifyAndClear(&observer_); + EXPECT_TRUE(IsFocused(first_lifecycle_unit)); + + // Expect notifications when tabs are closed. + EXPECT_CALL(observer_, OnLifecycleUnitDestroyed(first_lifecycle_unit)); + tab_strip_model_->CloseAllTabs(); +} + +TEST_F(TabLifecycleUnitSourceTest, ReplaceWebContents) { + LifecycleUnit* first_lifecycle_unit = nullptr; + LifecycleUnit* second_lifecycle_unit = nullptr; + CreateTwoTabs(true /* focus_tab_strip */, &first_lifecycle_unit, + &second_lifecycle_unit); + + // Replace the WebContents in the active tab with a second WebContents. Expect + // GetTabLifecycleUnitExternal() to return the TabLifecycleUnitExternal when + // called with the second WebContents as argument. + content::WebContents* original_web_contents = + tab_strip_model_->GetWebContentsAt(1); + TabLifecycleUnitExternal* tab_lifecycle_unit_external = + source_.GetTabLifecycleUnitExternal(original_web_contents); + content::WebContents* new_web_contents = CreateTestWebContents(); + EXPECT_EQ(original_web_contents, + tab_strip_model_->ReplaceWebContentsAt(1, new_web_contents)); + EXPECT_FALSE(source_.GetTabLifecycleUnitExternal(original_web_contents)); + EXPECT_EQ(tab_lifecycle_unit_external, + source_.GetTabLifecycleUnitExternal(new_web_contents)); + + delete original_web_contents; + + // Expect notifications when tabs are closed. + EXPECT_CALL(observer_, OnLifecycleUnitDestroyed(first_lifecycle_unit)); + EXPECT_CALL(observer_, OnLifecycleUnitDestroyed(second_lifecycle_unit)); + tab_strip_model_->CloseAllTabs(); +} + +} // namespace resource_coordinator
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc index de172b47..370a0f0 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
@@ -11,6 +11,7 @@ #include "base/test/simple_test_tick_clock.h" #include "chrome/browser/resource_coordinator/tab_lifecycle_observer.h" #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" +#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h" #include "chrome/browser/resource_coordinator/time.h" #include "chrome/browser/ui/tabs/tab_strip_model_impl.h" #include "chrome/browser/ui/tabs/test_tab_strip_model_delegate.h" @@ -43,6 +44,8 @@ class TabLifecycleUnitTest : public ChromeRenderViewHostTestHarness { protected: + using TabLifecycleUnit = TabLifecycleUnitSource::TabLifecycleUnit; + TabLifecycleUnitTest() : scoped_set_tick_clock_for_testing_(&test_clock_) { observers_.AddObserver(&observer_); }
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc index f1ef4e1..d2b6695 100644 --- a/chrome/browser/themes/theme_service.cc +++ b/chrome/browser/themes/theme_service.cc
@@ -492,7 +492,7 @@ ui::GetAuraColor(id == ThemeProperties::COLOR_TAB_THROBBER_SPINNING ? ui::NativeTheme::kColorId_ThrobberSpinningColor : ui::NativeTheme::kColorId_ThrobberWaitingColor, - nullptr); + ui::NativeTheme::GetInstanceForNativeUi()); color_utils::HSL hsl = GetTint(ThemeProperties::TINT_BUTTONS, incognito); return color_utils::HSLShift(base_color, hsl); }
diff --git a/chrome/browser/ui/extensions/hosted_app_browsertest.cc b/chrome/browser/ui/extensions/hosted_app_browsertest.cc index e3ad15b1..5da7b984 100644 --- a/chrome/browser/ui/extensions/hosted_app_browsertest.cc +++ b/chrome/browser/ui/extensions/hosted_app_browsertest.cc
@@ -727,11 +727,11 @@ // Verify that |same_dir| and |diff_dir| can script each other. // (they should - they have the same origin). std::string inner_text_from_other_frame; - ASSERT_TRUE(content::ExecuteScriptAndExtractString( - diff_dir, + const std::string r_script = R"( var w = window.open('', 'SameOrigin-SamePath'); - domAutomationController.send(w.document.body.innerText); )", - &inner_text_from_other_frame)); + domAutomationController.send(w.document.body.innerText); )"; + ASSERT_TRUE(content::ExecuteScriptAndExtractString( + diff_dir, r_script, &inner_text_from_other_frame)); EXPECT_EQ("Simple test page.", inner_text_from_other_frame); }
diff --git a/chrome/browser/ui/views/harmony/harmony_typography_provider.cc b/chrome/browser/ui/views/harmony/harmony_typography_provider.cc index 6820a98..2357baa3 100644 --- a/chrome/browser/ui/views/harmony/harmony_typography_provider.cc +++ b/chrome/browser/ui/views/harmony/harmony_typography_provider.cc
@@ -31,10 +31,9 @@ // in Windows 10 still has black text, but (since the user wants high contrast) // the grey text shades in Harmony should not be used. bool ShouldIgnoreHarmonySpec(const ui::NativeTheme& theme) { -#if defined(OS_WIN) - if (ui::NativeThemeWin::IsUsingHighContrastTheme()) + if (theme.UsesHighContrastColors()) return true; -#endif + constexpr auto kTestColorId = ui::NativeTheme::kColorId_LabelEnabledColor; return theme.GetSystemColor(kTestColorId) != SK_ColorBLACK; }
diff --git a/chrome/browser/ui/views/settings_reset_prompt_dialog.cc b/chrome/browser/ui/views/settings_reset_prompt_dialog.cc index cfd0bfb..bd7918b5 100644 --- a/chrome/browser/ui/views/settings_reset_prompt_dialog.cc +++ b/chrome/browser/ui/views/settings_reset_prompt_dialog.cc
@@ -32,10 +32,6 @@ } // namespace chrome -namespace { -constexpr int kDialogWidth = 448; -} // namespace - SettingsResetPromptDialog::SettingsResetPromptDialog( safe_browsing::SettingsResetPromptController* controller) : browser_(nullptr), controller_(controller) { @@ -47,6 +43,7 @@ views::StyledLabel* dialog_label = new views::StyledLabel(controller_->GetMainText(), /*listener=*/nullptr); + dialog_label->SetTextContext(CONTEXT_BODY_TEXT_LARGE); views::StyledLabel::RangeStyleInfo url_style; url_style.text_style = STYLE_EMPHASIZED; dialog_label->AddStyleRange(controller_->GetMainTextUrlRange(), url_style); @@ -82,6 +79,10 @@ return false; } +bool SettingsResetPromptDialog::ShouldShowCloseButton() const { + return false; +} + base::string16 SettingsResetPromptDialog::GetWindowTitle() const { DCHECK(controller_); return controller_->GetWindowTitle(); @@ -126,5 +127,8 @@ // View overrides. gfx::Size SettingsResetPromptDialog::CalculatePreferredSize() const { - return gfx::Size(kDialogWidth, GetHeightForWidth(kDialogWidth)); + const int width = ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH) - + margins().width(); + return gfx::Size(width, GetHeightForWidth(width)); }
diff --git a/chrome/browser/ui/views/settings_reset_prompt_dialog.h b/chrome/browser/ui/views/settings_reset_prompt_dialog.h index 033555c6f..6ff6041 100644 --- a/chrome/browser/ui/views/settings_reset_prompt_dialog.h +++ b/chrome/browser/ui/views/settings_reset_prompt_dialog.h
@@ -38,6 +38,7 @@ ui::ModalType GetModalType() const override; bool ShouldShowWindowIcon() const override; base::string16 GetWindowTitle() const override; + bool ShouldShowCloseButton() const override; // views::DialogDelegate overrides. base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
diff --git a/chrome/browser/win/titlebar_config.cc b/chrome/browser/win/titlebar_config.cc index 8541260..09fc359 100644 --- a/chrome/browser/win/titlebar_config.cc +++ b/chrome/browser/win/titlebar_config.cc
@@ -14,7 +14,7 @@ // mode so that we can correctly draw the caption buttons on the left in RTL // mode. But they require a different style and color selection that isn't // currently implemented. - return !ui::NativeThemeWin::IsUsingHighContrastTheme() && + return !ui::NativeTheme::GetInstanceForNativeUi()->UsesHighContrastColors() && base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kWindows10CustomTitlebar) && base::win::GetVersion() >= base::win::VERSION_WIN10;
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index d533968..5f948d2 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2767,6 +2767,7 @@ "../browser/page_load_metrics/observers/session_restore_page_load_metrics_observer_unittest.cc", "../browser/resource_coordinator/background_tab_navigation_throttle_unittest.cc", "../browser/resource_coordinator/lifecycle_unit_unittest.cc", + "../browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc", "../browser/resource_coordinator/tab_lifecycle_unit_unittest.cc", "../browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc", "../browser/resource_coordinator/tab_manager_stats_collector_unittest.cc",
diff --git a/chromecast/crash/app_state_tracker.cc b/chromecast/crash/app_state_tracker.cc index 8910723..05ef940 100644 --- a/chromecast/crash/app_state_tracker.cc +++ b/chromecast/crash/app_state_tracker.cc
@@ -6,6 +6,7 @@ #include "base/lazy_instance.h" #include "chromecast/crash/cast_crash_keys.h" +#include "components/crash/core/common/crash_key.h" namespace { @@ -45,9 +46,7 @@ void AppStateTracker::SetLastLaunchedApp(const std::string& app_id) { GetAppState()->last_launched_app = app_id; - // TODO(slan): Currently SetCrashKeyValue is a no-op on chromecast until - // we add call to InitCrashKeys - base::debug::SetCrashKeyValue(crash_keys::kLastApp, app_id); + crash_keys::last_app.Set(app_id); } // static @@ -56,9 +55,10 @@ app_state->previous_app = app_state->current_app; app_state->current_app = app_id; - base::debug::SetCrashKeyValue(crash_keys::kCurrentApp, app_id); - base::debug::SetCrashKeyValue(crash_keys::kPreviousApp, - app_state->previous_app); + static crash_reporter::CrashKeyString<64> current_app("current_app"); + current_app.Set(app_id); + + crash_keys::previous_app.Set(app_state->previous_app); } } // namespace chromecast
diff --git a/chromecast/crash/cast_crash_keys.cc b/chromecast/crash/cast_crash_keys.cc index e253489..d6e9b8f 100644 --- a/chromecast/crash/cast_crash_keys.cc +++ b/chromecast/crash/cast_crash_keys.cc
@@ -4,21 +4,14 @@ #include "chromecast/crash/cast_crash_keys.h" +#include "base/debug/crash_logging.h" #include "components/crash/core/common/crash_keys.h" namespace chromecast { namespace crash_keys { -const char kLastApp[] = "last_app"; -const char kCurrentApp[] = "current_app"; -const char kPreviousApp[] = "previous_app"; - size_t RegisterCastCrashKeys() { const base::debug::CrashKey fixed_keys[] = { - {kLastApp, ::crash_keys::kSmallSize}, - {kCurrentApp, ::crash_keys::kSmallSize}, - {kPreviousApp, ::crash_keys::kSmallSize}, - // TODO(sanfin): The following crash keys are copied from // chrome/common/crash_keys.cc. When http://crbug.com/598854 is fixed, // remove these and refactor as necessary. @@ -48,5 +41,9 @@ ::crash_keys::kChunkMaxLength); } +crash_reporter::CrashKeyString<64> last_app("last_app"); + +crash_reporter::CrashKeyString<64> previous_app("previous_app"); + } // namespace crash_keys } // namespace chromecast
diff --git a/chromecast/crash/cast_crash_keys.h b/chromecast/crash/cast_crash_keys.h index 1306384..df44d643 100644 --- a/chromecast/crash/cast_crash_keys.h +++ b/chromecast/crash/cast_crash_keys.h
@@ -7,16 +7,16 @@ #include <stddef.h> -#include "base/debug/crash_logging.h" +#include "components/crash/core/common/crash_key.h" namespace chromecast { namespace crash_keys { size_t RegisterCastCrashKeys(); -extern const char kCurrentApp[]; -extern const char kLastApp[]; -extern const char kPreviousApp[]; +extern crash_reporter::CrashKeyString<64> last_app; + +extern crash_reporter::CrashKeyString<64> previous_app; } // namespace chromecast } // namespace crash_keys
diff --git a/chromecast/media/cma/backend/post_processing_pipeline_impl.cc b/chromecast/media/cma/backend/post_processing_pipeline_impl.cc index 2f29d6a0e..27c3619 100644 --- a/chromecast/media/cma/backend/post_processing_pipeline_impl.cc +++ b/chromecast/media/cma/backend/post_processing_pipeline_impl.cc
@@ -154,8 +154,8 @@ [&name](PostProcessorInfo& p) { return p.name == name; }); if (it != processors_.end()) { it->ptr->UpdateParameters(config); - LOG(INFO) << "Config string: " << config - << " was delivered to postprocessor " << name; + VLOG(1) << "Config string: " << config << " was delivered to postprocessor " + << name; } }
diff --git a/chromecast/renderer/cast_content_renderer_client.cc b/chromecast/renderer/cast_content_renderer_client.cc index 6d3a000..0e395f90 100644 --- a/chromecast/renderer/cast_content_renderer_client.cc +++ b/chromecast/renderer/cast_content_renderer_client.cc
@@ -104,12 +104,12 @@ std::string last_launched_app = command_line->GetSwitchValueNative(switches::kLastLaunchedApp); if (!last_launched_app.empty()) - base::debug::SetCrashKeyValue(crash_keys::kLastApp, last_launched_app); + crash_keys::last_app.Set(last_launched_app); std::string previous_app = command_line->GetSwitchValueNative(switches::kPreviousApp); if (!previous_app.empty()) - base::debug::SetCrashKeyValue(crash_keys::kPreviousApp, previous_app); + crash_keys::previous_app.Set(previous_app); #endif // !defined(OS_FUCHSIA) }
diff --git a/chromeos/dbus/smb_provider_client.cc b/chromeos/dbus/smb_provider_client.cc index f0d0fea6..c0cc2ca 100644 --- a/chromeos/dbus/smb_provider_client.cc +++ b/chromeos/dbus/smb_provider_client.cc
@@ -138,7 +138,7 @@ return; } int32_t mount_id = -1; - if (!reader.PopInt32(&mount_id) || mount_id <= 0) { + if (!reader.PopInt32(&mount_id) || mount_id < 0) { DLOG(ERROR) << "Mount: failed to parse mount id"; std::move(callback).Run(smbprovider::ERROR_DBUS_PARSE_FAILED, -1); return;
diff --git a/components/autofill/core/browser/credit_card_save_manager_unittest.cc b/components/autofill/core/browser/credit_card_save_manager_unittest.cc index 11d47e9..2ddf748 100644 --- a/components/autofill/core/browser/credit_card_save_manager_unittest.cc +++ b/components/autofill/core/browser/credit_card_save_manager_unittest.cc
@@ -162,48 +162,27 @@ TestPersonalDataManager* personal_data) : AutofillManager(driver, client, personal_data), personal_data_(personal_data), - context_getter_(driver->GetURLRequestContext()), test_form_data_importer_( new TestFormDataImporter(client, payments_client, credit_card_save_manager, personal_data, - "en-US")), - autofill_enabled_(true), - credit_card_enabled_(true), - expected_observed_submission_(true), - call_parent_upload_form_data_(false) { + "en-US")) { set_payments_client(payments_client); set_form_data_importer(test_form_data_importer_); } ~TestAutofillManager() override {} - bool IsAutofillEnabled() const override { return autofill_enabled_; } - - void set_autofill_enabled(bool autofill_enabled) { - autofill_enabled_ = autofill_enabled; - } + bool IsAutofillEnabled() const override { return true; } bool IsCreditCardAutofillEnabled() override { return credit_card_enabled_; } - void set_credit_card_enabled(bool credit_card_enabled) { + void SetCreditCardEnabled(bool credit_card_enabled) { credit_card_enabled_ = credit_card_enabled; - if (!credit_card_enabled_) + if (!credit_card_enabled_) { // Credit card data is refreshed when this pref is changed. personal_data_->ClearCreditCards(); - } - - void set_expected_submitted_field_types( - const std::vector<ServerFieldTypeSet>& expected_types) { - expected_submitted_field_types_ = expected_types; - } - - void set_expected_observed_submission(bool expected) { - expected_observed_submission_ = expected; - } - - void set_call_parent_upload_form_data(bool value) { - call_parent_upload_form_data_ = value; + } } void UploadFormDataAsyncCallback(const FormStructure* submitted_form, @@ -213,7 +192,7 @@ bool observed_submission) override { run_loop_->Quit(); - EXPECT_EQ(expected_observed_submission_, observed_submission); + EXPECT_TRUE(observed_submission); // If we have expected field types set, make sure they match. if (!expected_submitted_field_types_.empty()) { @@ -243,73 +222,18 @@ // Resets the run loop so that it can wait for an asynchronous form // submission to complete. - void ResetRunLoop() { run_loop_.reset(new base::RunLoop()); } + void ResetRunLoop() { run_loop_ = std::make_unique<base::RunLoop>(); } // Wait for the asynchronous calls within StartUploadProcess() to complete. void WaitForAsyncUploadProcess() { run_loop_->Run(); } - void UploadFormData(const FormStructure& submitted_form, - bool observed_submission) override { - submitted_form_signature_ = submitted_form.FormSignatureAsStr(); - - if (call_parent_upload_form_data_) - AutofillManager::UploadFormData(submitted_form, observed_submission); - } - - const std::string GetSubmittedFormSignature() { - return submitted_form_signature_; - } - - AutofillProfile* GetProfileWithGUID(const char* guid) { - return personal_data_->GetProfileWithGUID(guid); - } - - CreditCard* GetCreditCardWithGUID(const char* guid) { - return personal_data_->GetCreditCardWithGUID(guid); - } - - std::vector<CreditCard*> GetLocalCreditCards() const { - return personal_data_->GetLocalCreditCards(); - } - - std::vector<CreditCard*> GetCreditCards() const { - return personal_data_->GetCreditCards(); - } - - void AddProfile(std::unique_ptr<AutofillProfile> profile) { - personal_data_->AddProfile(*profile); - } - - void AddCreditCard(const CreditCard& credit_card) { - personal_data_->AddCreditCard(credit_card); - } - - int GetPackedCreditCardID(int credit_card_id) { - std::string credit_card_guid = - base::StringPrintf("00000000-0000-0000-0000-%012d", credit_card_id); - - return MakeFrontendID(credit_card_guid, std::string()); - } - - void AddSeenForm(std::unique_ptr<FormStructure> form) { - form->set_form_parsed_timestamp(base::TimeTicks::Now()); - form_structures()->push_back(std::move(form)); - } - - void ClearFormStructures() { form_structures()->clear(); } - private: TestPersonalDataManager* personal_data_; // Weak reference. - net::URLRequestContextGetter* context_getter_; // Weak reference. TestFormDataImporter* test_form_data_importer_; - bool autofill_enabled_; - bool credit_card_enabled_; - bool expected_observed_submission_; - bool call_parent_upload_form_data_; + bool credit_card_enabled_ = true; std::unique_ptr<base::RunLoop> run_loop_; - std::string submitted_form_signature_; std::vector<ServerFieldTypeSet> expected_submitted_field_types_; DISALLOW_COPY_AND_ASSIGN(TestAutofillManager); @@ -327,9 +251,7 @@ payments_client, "en-US", personal_data_manager), - test_payments_client_(payments_client), - credit_card_upload_enabled_(false), - credit_card_was_uploaded_(false) { + test_payments_client_(payments_client) { if (test_payments_client_) { test_payments_client_->SetSaveDelegate(this); } @@ -366,8 +288,8 @@ }; TestPaymentsClient* test_payments_client_; // Weak reference. - bool credit_card_upload_enabled_; - bool credit_card_was_uploaded_; + bool credit_card_upload_enabled_ = false; + bool credit_card_was_uploaded_ = false; DISALLOW_COPY_AND_ASSIGN(TestCreditCardSaveManager); }; @@ -671,7 +593,7 @@ TEST_F(CreditCardSaveManagerTest, CreditCardDisabledDoesNotSave) { personal_data_.ClearProfiles(); - autofill_manager_->set_credit_card_enabled(false); + autofill_manager_->SetCreditCardEnabled(false); // Create, fill and submit an address form in order to establish a recent // profile which can be selected for the upload request. @@ -740,7 +662,7 @@ EXPECT_TRUE(credit_card_save_manager_->GetActiveExperiments().empty()); // Server did not send a server_id, expect copy of card is not stored. - EXPECT_TRUE(autofill_manager_->GetCreditCards().empty()); + EXPECT_TRUE(personal_data_.GetCreditCards().empty()); // Verify that the correct histogram entry (and only that) was logged. ExpectUniqueCardUploadDecision(histogram_tester, AutofillMetrics::UPLOAD_OFFERED); @@ -824,13 +746,13 @@ FormSubmitted(credit_card_form); EXPECT_TRUE(credit_card_save_manager_->credit_card_was_uploaded()); - EXPECT_TRUE(autofill_manager_->GetLocalCreditCards().empty()); + EXPECT_TRUE(personal_data_.GetLocalCreditCards().empty()); #if defined(OS_LINUX) && !defined(OS_CHROMEOS) // See |OfferStoreUnmaskedCards| - EXPECT_TRUE(autofill_manager_->GetCreditCards().empty()); + EXPECT_TRUE(personal_data_.GetCreditCards().empty()); #else - ASSERT_EQ(1U, autofill_manager_->GetCreditCards().size()); - const CreditCard* const saved_card = autofill_manager_->GetCreditCards()[0]; + ASSERT_EQ(1U, personal_data_.GetCreditCards().size()); + const CreditCard* const saved_card = personal_data_.GetCreditCards()[0]; EXPECT_EQ(CreditCard::OK, saved_card->GetServerStatus()); EXPECT_EQ(base::ASCIIToUTF16("1111"), saved_card->LastFourDigits()); EXPECT_EQ(kVisaCard, saved_card->network());
diff --git a/components/exo/client_controlled_shell_surface.cc b/components/exo/client_controlled_shell_surface.cc index 13d5836..a2814f62 100644 --- a/components/exo/client_controlled_shell_surface.cc +++ b/components/exo/client_controlled_shell_surface.cc
@@ -169,7 +169,7 @@ } // namespace //////////////////////////////////////////////////////////////////////////////// -// ShellSurface, public: +// ClientControlledShellSurface, public: ClientControlledShellSurface::ClientControlledShellSurface(Surface* surface, bool can_minimize, @@ -316,6 +316,14 @@ pending_top_inset_height_ = height; } +void ClientControlledShellSurface::SetResizeOutset(int outset) { + TRACE_EVENT1("exo", "ClientControlledShellSurface::SetResizeOutset", "outset", + outset); + + if (root_surface()) + root_surface()->SetInputOutset(outset); +} + void ClientControlledShellSurface::OnWindowStateChangeEvent( ash::mojom::WindowStateType current_state, ash::mojom::WindowStateType next_state) { @@ -328,6 +336,10 @@ void ClientControlledShellSurface::OnSurfaceCommit() { ShellSurfaceBase::OnSurfaceCommit(); + + if (!geometry_changed_callback_.is_null()) + geometry_changed_callback_.Run(GetVisibleBounds()); + if (widget_) { // Apply new top inset height. if (pending_top_inset_height_ != top_inset_height_) { @@ -464,7 +476,7 @@ // ShellSurface overrides: void ClientControlledShellSurface::SetWidgetBounds(const gfx::Rect& bounds) { - if (!resizer_) { + if (!resizer_ || resizer_->details().window_component != HTCAPTION) { client_controlled_state_->set_bounds_locally(true); widget_->SetBounds(bounds); client_controlled_state_->set_bounds_locally(false); @@ -492,6 +504,23 @@ resizer_->Drag(GetMouseLocation(), 0); } +gfx::Rect ClientControlledShellSurface::GetShadowBounds() const { + gfx::Rect shadow_bounds = ShellSurfaceBase::GetShadowBounds(); + + if (geometry_changed_callback_.is_null()) { + aura::Window* window = widget_->GetNativeWindow(); + + // Convert from screen to display coordinates. + shadow_bounds -= origin_offset_; + wm::ConvertRectFromScreen(window->parent(), &shadow_bounds); + + // Convert from display to window coordinates. + shadow_bounds -= window->bounds().OffsetFromOrigin(); + } + + return shadow_bounds; +} + void ClientControlledShellSurface::InitializeWindowState( ash::wm::WindowState* window_state) { // Allow the client to request bounds that do not fill the entire work area @@ -527,15 +556,21 @@ int component) { ash::wm::WindowState* window_state = GetWindowState(); DCHECK(!window_state->drag_details()); - DCHECK(component == HTCAPTION); window_state->CreateDragDetails(GetMouseLocation(), component, wm::WINDOW_MOVE_SOURCE_MOUSE); - // Chained with a CustomWindowResizer, DragWindowResizer does not handle - // dragging. It only renders phantom windows and moves the window to the - // target root window when dragging ends. - return std::unique_ptr<ash::WindowResizer>(ash::DragWindowResizer::Create( - new CustomWindowResizer(window_state), window_state)); + std::unique_ptr<ash::WindowResizer> resizer = + std::make_unique<CustomWindowResizer>(window_state); + + if (component == HTCAPTION) { + // Chained with a CustomWindowResizer, DragWindowResizer does not handle + // dragging. It only renders phantom windows and moves the window to the + // target root window when dragging ends. + resizer.reset( + ash::DragWindowResizer::Create(resizer.release(), window_state)); + } + + return resizer; } bool ClientControlledShellSurface::OnMouseDragged(const ui::MouseEvent&) { @@ -546,13 +581,14 @@ } gfx::Point ClientControlledShellSurface::GetWidgetOrigin() const { - return origin_ - GetSurfaceOrigin().OffsetFromOrigin(); + return GetVisibleBounds().origin() - origin_offset_; } gfx::Point ClientControlledShellSurface::GetSurfaceOrigin() const { DCHECK(resize_component_ == HTCAPTION); - gfx::Rect visible_bounds = GetVisibleBounds(); - return origin_ + origin_offset_ - visible_bounds.OffsetFromOrigin(); + if (!geometry_changed_callback_.is_null()) + return gfx::Point(); + return gfx::Point() - GetWidgetOrigin().OffsetFromOrigin(); } ////////////////////////////////////////////////////////////////////////////////
diff --git a/components/exo/client_controlled_shell_surface.h b/components/exo/client_controlled_shell_surface.h index 96a2574..2284ecc0 100644 --- a/components/exo/client_controlled_shell_surface.h +++ b/components/exo/client_controlled_shell_surface.h
@@ -38,11 +38,18 @@ public ash::WindowTreeHostManager::Observer, public ui::CompositorLockClient { public: + using GeometryChangedCallback = + base::RepeatingCallback<void(const gfx::Rect& geometry)>; + ClientControlledShellSurface(Surface* surface, bool can_minimize, int container); ~ClientControlledShellSurface() override; + void set_geometry_changed_callback(const GeometryChangedCallback& callback) { + geometry_changed_callback_ = callback; + } + // Called when the client was maximized. void SetMaximized(); @@ -85,6 +92,9 @@ // Set top inset for surface. void SetTopInset(int height); + // Set resize outset for surface. + void SetResizeOutset(int outset); + // Sends the window state change event to client. void OnWindowStateChangeEvent(ash::mojom::WindowStateType old_state, ash::mojom::WindowStateType next_state); @@ -130,6 +140,7 @@ private: // Overridden from ShellSurface: void SetWidgetBounds(const gfx::Rect& bounds) override; + gfx::Rect GetShadowBounds() const override; void InitializeWindowState(ash::wm::WindowState* window_state) override; void UpdateBackdrop() override; float GetScale() const override; @@ -150,6 +161,7 @@ ash::wm::WindowState* GetWindowState(); + GeometryChangedCallback geometry_changed_callback_; int64_t primary_display_id_; int top_inset_height_ = 0;
diff --git a/components/exo/shell_surface.h b/components/exo/shell_surface.h index 247bdf9..e638990b 100644 --- a/components/exo/shell_surface.h +++ b/components/exo/shell_surface.h
@@ -49,7 +49,7 @@ // surface should be resized. void Resize(int component); - // Overridden from ShellsurfaceBase: + // Overridden from ShellSurfaceBase: void InitializeWindowState(ash::wm::WindowState* window_state) override; private:
diff --git a/components/exo/shell_surface_base.cc b/components/exo/shell_surface_base.cc index 1c880f11..201718a 100644 --- a/components/exo/shell_surface_base.cc +++ b/components/exo/shell_surface_base.cc
@@ -1252,27 +1252,12 @@ } else { wm::SetShadowElevation(window, wm::ShadowElevation::DEFAULT); - gfx::Rect shadow_bounds; - if (shadow_bounds_->IsEmpty()) { - shadow_bounds = gfx::Rect(window->bounds().size()); - } else { - shadow_bounds = - gfx::ScaleToEnclosedRect(*shadow_bounds_, 1.f / GetScale()); - - // Convert from screen to display coordinates. - shadow_bounds -= origin_offset_; - wm::ConvertRectFromScreen(window->parent(), &shadow_bounds); - - // Convert from display to window coordinates. - shadow_bounds -= window->bounds().OffsetFromOrigin(); - } - wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window); // Maximized/Fullscreen window does not create a shadow. if (!shadow) return; - shadow->SetContentBounds(shadow_bounds); + shadow->SetContentBounds(GetShadowBounds()); // Surfaces that can't be activated are usually menus and tooltips. Use a // small style shadow for them. if (!activatable_) @@ -1301,6 +1286,12 @@ return location; } +gfx::Rect ShellSurfaceBase::GetShadowBounds() const { + return shadow_bounds_->IsEmpty() + ? gfx::Rect(widget_->GetNativeWindow()->bounds().size()) + : gfx::ScaleToEnclosedRect(*shadow_bounds_, 1.f / GetScale()); +} + //////////////////////////////////////////////////////////////////////////////// // ShellSurfaceBase, private:
diff --git a/components/exo/shell_surface_base.h b/components/exo/shell_surface_base.h index d1edd36..d39e310 100644 --- a/components/exo/shell_surface_base.h +++ b/components/exo/shell_surface_base.h
@@ -266,6 +266,9 @@ // In the coordinate system of the parent root window. gfx::Point GetMouseLocation() const; + // In the local coordinate system of the window. + virtual gfx::Rect GetShadowBounds() const; + // Attempt to start a drag operation. The type of drag operation to start is // determined by |component|. void AttemptToStartDrag(int component);
diff --git a/components/exo/surface.cc b/components/exo/surface.cc index 52ddffba..70c976d3 100644 --- a/components/exo/surface.cc +++ b/components/exo/surface.cc
@@ -261,6 +261,12 @@ pending_state_.input_region = region; } +void Surface::SetInputOutset(int outset) { + TRACE_EVENT1("exo", "Surface::SetInputOutset", "outset", outset); + + pending_state_.input_outset = outset; +} + void Surface::SetBufferScale(float scale) { TRACE_EVENT1("exo", "Surface::SetBufferScale", "scale", scale); @@ -538,6 +544,13 @@ hit_test_region_ = state_.input_region; hit_test_region_.Intersect(surface_hierarchy_content_bounds_); + int outset = state_.input_outset; + if (outset > 0) { + gfx::Rect input_rect = surface_hierarchy_content_bounds_; + input_rect.Inset(-outset, -outset); + hit_test_region_ = input_rect; + } + for (const auto& sub_surface_entry : base::Reversed(sub_surfaces_)) { auto* sub_surface = sub_surface_entry.first; gfx::Vector2d offset = sub_surface_entry.second.OffsetFromOrigin();
diff --git a/components/exo/surface.h b/components/exo/surface.h index a5b59e1c..eacb0b1 100644 --- a/components/exo/surface.h +++ b/components/exo/surface.h
@@ -101,6 +101,10 @@ // events. The region is clipped to the surface bounds. void SetInputRegion(const cc::Region& region); + // This overrides the input region to the surface bounds with an outset. + // TODO(domlaskowski): Remove this once client-driven resizing is removed. + void SetInputOutset(int outset); + // This sets the scaling factor used to interpret the contents of the buffer // attached to the surface. Note that if the scale is larger than 1, then you // have to attach a buffer that is larger (by a factor of scale in each @@ -247,6 +251,7 @@ cc::Region opaque_region; cc::Region input_region; + int input_outset = 0; float buffer_scale = 1.0f; Transform buffer_transform = Transform::NORMAL; gfx::Size viewport;
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc index 4f871bb..c1edbae 100644 --- a/components/exo/wayland/server.cc +++ b/components/exo/wayland/server.cc
@@ -2029,6 +2029,17 @@ } } +void remote_surface_resize(wl_client* client, wl_resource* resource) { + GetUserDataAs<ShellSurface>(resource)->Resize(HTBORDER); +} + +void remote_surface_set_resize_outset(wl_client* client, + wl_resource* resource, + int32_t outset) { + GetUserDataAs<ClientControlledShellSurface>(resource)->SetResizeOutset( + outset); +} + const struct zcr_remote_surface_v1_interface remote_surface_implementation = { remote_surface_destroy, remote_surface_set_app_id, @@ -2055,7 +2066,9 @@ remote_surface_ack_configure, remote_surface_move, remote_surface_set_orientation, - remote_surface_set_window_type}; + remote_surface_set_window_type, + remote_surface_resize, + remote_surface_set_resize_outset}; //////////////////////////////////////////////////////////////////////////////// // notification_surface_interface: @@ -2109,6 +2122,10 @@ display::Screen::GetScreen()->RemoveObserver(this); } + bool HasRelativeSurfaceHierarchy() const { + return wl_resource_get_version(remote_shell_resource_) >= 9; + } + std::unique_ptr<ClientControlledShellSurface> CreateShellSurface( Surface* surface, int container, @@ -2334,6 +2351,14 @@ return serial; } +void HandleRemoteSurfaceGeometryChangedCallback(wl_resource* resource, + const gfx::Rect& geometry) { + zcr_remote_surface_v1_send_window_geometry_changed( + resource, geometry.x(), geometry.y(), geometry.width(), + geometry.height()); + wl_client_flush(wl_resource_get_client(resource)); +} + void remote_shell_get_remote_surface(wl_client* client, wl_resource* resource, uint32_t id, @@ -2367,6 +2392,11 @@ shell_surface->set_configure_callback( base::Bind(&HandleRemoteSurfaceConfigureCallback, base::Unretained(remote_surface_resource))); + if (shell->HasRelativeSurfaceHierarchy()) { + shell_surface->set_geometry_changed_callback( + base::BindRepeating(&HandleRemoteSurfaceGeometryChangedCallback, + base::Unretained(remote_surface_resource))); + } SetImplementation(remote_surface_resource, &remote_surface_implementation, std::move(shell_surface)); @@ -2405,7 +2435,7 @@ remote_shell_destroy, remote_shell_get_remote_surface, remote_shell_get_notification_surface}; -const uint32_t remote_shell_version = 8; +const uint32_t remote_shell_version = 9; void bind_remote_shell(wl_client* client, void* data,
diff --git a/components/feedback/system_logs/system_logs_fetcher.cc b/components/feedback/system_logs/system_logs_fetcher.cc index 74fb95ad..936ba195 100644 --- a/components/feedback/system_logs/system_logs_fetcher.cc +++ b/components/feedback/system_logs/system_logs_fetcher.cc
@@ -71,12 +71,12 @@ num_pending_requests_++; } -void SystemLogsFetcher::Fetch(const SysLogsFetcherCallback& callback) { +void SystemLogsFetcher::Fetch(SysLogsFetcherCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(callback_.is_null()); DCHECK(!callback.is_null()); - callback_ = callback; + callback_ = std::move(callback); for (size_t i = 0; i < data_sources_.size(); ++i) { VLOG(1) << "Fetching SystemLogSource: " << data_sources_[i]->source_name(); data_sources_[i]->Fetch(base::Bind(&SystemLogsFetcher::OnFetched, @@ -122,7 +122,9 @@ if (num_pending_requests_ > 0) return; - callback_.Run(std::move(response_)); + DCHECK(!callback_.is_null()); + std::move(callback_).Run(std::move(response_)); + BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this); }
diff --git a/components/feedback/system_logs/system_logs_fetcher.h b/components/feedback/system_logs/system_logs_fetcher.h index 18ad0b3..d8103b6 100644 --- a/components/feedback/system_logs/system_logs_fetcher.h +++ b/components/feedback/system_logs/system_logs_fetcher.h
@@ -24,7 +24,7 @@ // Callback that the SystemLogsFetcher uses to return data. using SysLogsFetcherCallback = - base::Callback<void(std::unique_ptr<SystemLogsResponse>)>; + base::OnceCallback<void(std::unique_ptr<SystemLogsResponse>)>; // The SystemLogsFetcher fetches key-value data from a list of log sources. // @@ -52,7 +52,7 @@ // Starts the fetch process. After the fetch completes, this instance calls // |callback|, then schedules itself to be deleted. - void Fetch(const SysLogsFetcherCallback& callback); + void Fetch(SysLogsFetcherCallback callback); private: // Callback passed to all the data sources. May call Scrub(), then calls
diff --git a/components/feedback/system_logs/system_logs_source.h b/components/feedback/system_logs/system_logs_source.h index 8a32d2d..bcd333e 100644 --- a/components/feedback/system_logs/system_logs_source.h +++ b/components/feedback/system_logs/system_logs_source.h
@@ -17,7 +17,7 @@ // Callback that the data sources use to return data. using SysLogsSourceCallback = - base::Callback<void(std::unique_ptr<SystemLogsResponse>)>; + base::OnceCallback<void(std::unique_ptr<SystemLogsResponse>)>; // The SystemLogsSource provides an interface for the data sources that // the SystemLogsFetcher class uses to fetch logs and other information. @@ -28,7 +28,7 @@ virtual ~SystemLogsSource(); // Fetches data and passes it by pointer to the callback - virtual void Fetch(const SysLogsSourceCallback& callback) = 0; + virtual void Fetch(SysLogsSourceCallback callback) = 0; const std::string& source_name() const { return source_name_; }
diff --git a/components/printing/common/print_messages.h b/components/printing/common/print_messages.h index 339e63c..34338e8 100644 --- a/components/printing/common/print_messages.h +++ b/components/printing/common/print_messages.h
@@ -276,8 +276,8 @@ #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) // Parameters to describe a rendered page. -IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params) - // A shared memory handle to the EMF data. This data can be quite large so a +IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintDocument_Params) + // A shared memory handle to the PDF data. This data can be quite large so a // memory map needs to be used. IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) @@ -287,9 +287,6 @@ // Cookie for the document to ensure correctness. IPC_STRUCT_MEMBER(int, document_cookie) - // Page number. - IPC_STRUCT_MEMBER(int, page_number) - // The size of the page the page author specified. IPC_STRUCT_MEMBER(gfx::Size, page_size) @@ -375,11 +372,11 @@ // Tells the browser that the print dialog has been shown. IPC_MESSAGE_ROUTED0(PrintHostMsg_DidShowPrintDialog) -// Sends back to the browser the rendered "printed page" that was requested by -// a PrintMsg_PrintPages message or from scripted printing. The memory handle in +// Sends back to the browser the rendered document that was requested by a +// PrintMsg_PrintPages message or from scripted printing. The memory handle in // this message is already valid in the browser process. -IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPrintPage, - PrintHostMsg_DidPrintPage_Params /* page content */) +IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPrintDocument, + PrintHostMsg_DidPrintDocument_Params /* page content */) // The renderer wants to know the default print settings. IPC_SYNC_MESSAGE_ROUTED0_1(PrintHostMsg_GetDefaultPrintSettings,
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc index 76bf7cf..88285d0 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -1676,11 +1676,13 @@ PdfMetafileSkia metafile(print_params.printed_doc_type); CHECK(metafile.Init()); - std::vector<gfx::Size> page_size_in_dpi(printed_pages.size()); - std::vector<gfx::Rect> content_area_in_dpi(printed_pages.size()); - for (size_t i = 0; i < printed_pages.size(); ++i) { + PrintHostMsg_DidPrintDocument_Params page_params; + PrintPageInternal(print_params, printed_pages[0], page_count, frame, + &metafile, &page_params.page_size, + &page_params.content_area); + for (size_t i = 1; i < printed_pages.size(); ++i) { PrintPageInternal(print_params, printed_pages[i], page_count, frame, - &metafile, &page_size_in_dpi[i], &content_area_in_dpi[i]); + &metafile, nullptr, nullptr); } // blink::printEnd() for PDF should be called before metafile is closed. @@ -1688,7 +1690,6 @@ metafile.FinishDocument(); - PrintHostMsg_DidPrintPage_Params page_params; if (!CopyMetafileDataToSharedMem(metafile, &page_params.metafile_data_handle)) { return false; @@ -1699,18 +1700,7 @@ #if defined(OS_WIN) page_params.physical_offsets = printer_printable_area_.origin(); #endif - for (size_t i = 0; i < printed_pages.size(); ++i) { - page_params.page_number = printed_pages[i]; - page_params.page_size = page_size_in_dpi[i]; - page_params.content_area = content_area_in_dpi[i]; - Send(new PrintHostMsg_DidPrintPage(routing_id(), page_params)); - // Send the rest of the pages with an invalid metafile handle. - // TODO(erikchen): Fix semantics. See https://crbug.com/640840 - if (page_params.metafile_data_handle.IsValid()) { - page_params.metafile_data_handle = base::SharedMemoryHandle(); - page_params.data_size = 0; - } - } + Send(new PrintHostMsg_DidPrintDocument(routing_id(), page_params)); return true; } #endif // defined(OS_MACOSX) || defined(OS_WIN)
diff --git a/components/printing/renderer/print_render_frame_helper_linux.cc b/components/printing/renderer/print_render_frame_helper_linux.cc index 769976b3..2d47730 100644 --- a/components/printing/renderer/print_render_frame_helper_linux.cc +++ b/components/printing/renderer/print_render_frame_helper_linux.cc
@@ -81,7 +81,7 @@ routing_id(), sequence_number, printed_pages.size())); return true; #else - PrintHostMsg_DidPrintPage_Params page_params; + PrintHostMsg_DidPrintDocument_Params page_params; if (!CopyMetafileDataToSharedMem(metafile, &page_params.metafile_data_handle)) { return false; @@ -89,15 +89,7 @@ page_params.data_size = metafile.GetDataSize(); page_params.document_cookie = print_params.document_cookie; - for (size_t i = 0; i < printed_pages.size(); ++i) { - page_params.page_number = printed_pages[i]; - Send(new PrintHostMsg_DidPrintPage(routing_id(), page_params)); - // Send the rest of the pages with an invalid metafile handle. - if (page_params.metafile_data_handle.IsValid()) { - page_params.metafile_data_handle = base::SharedMemoryHandle(); - page_params.data_size = 0; - } - } + Send(new PrintHostMsg_DidPrintDocument(routing_id(), page_params)); return true; #endif // defined(OS_ANDROID) }
diff --git a/components/printing/test/mock_printer.cc b/components/printing/test/mock_printer.cc index 15d4a33..fb3c7814 100644 --- a/components/printing/test/mock_printer.cc +++ b/components/printing/test/mock_printer.cc
@@ -194,13 +194,12 @@ pages_.clear(); } -void MockPrinter::PrintPage(const PrintHostMsg_DidPrintPage_Params& params) { +void MockPrinter::PrintPage( + const PrintHostMsg_DidPrintDocument_Params& params) { // Verify the input parameter and update the printer status so that the // RenderViewTest class can verify the this function finishes without errors. EXPECT_EQ(PRINTER_PRINTING, printer_status_); EXPECT_EQ(document_cookie_, params.document_cookie); - EXPECT_EQ(page_number_, params.page_number); - EXPECT_LE(params.page_number, number_pages_); #if defined(OS_WIN) || defined(OS_MACOSX) // Load the data sent from a RenderView object and create a PageData object.
diff --git a/components/printing/test/mock_printer.h b/components/printing/test/mock_printer.h index 0adb9af0..dc6b2c61 100644 --- a/components/printing/test/mock_printer.h +++ b/components/printing/test/mock_printer.h
@@ -21,7 +21,7 @@ struct PrintMsg_Print_Params; struct PrintMsg_PrintPages_Params; -struct PrintHostMsg_DidPrintPage_Params; +struct PrintHostMsg_DidPrintDocument_Params; // A class which represents an output page used in the MockPrinter class. // The MockPrinter class stores output pages in a vector, so, this class @@ -89,7 +89,7 @@ const gfx::Size& page_size, int scale_factor); void SetPrintedPagesCount(int cookie, int number_pages); - void PrintPage(const PrintHostMsg_DidPrintPage_Params& params); + void PrintPage(const PrintHostMsg_DidPrintDocument_Params& params); // Functions that retrieve the output pages. Status GetPrinterStatus() const { return printer_status_; }
diff --git a/components/printing/test/print_mock_render_thread.cc b/components/printing/test/print_mock_render_thread.cc index 4b292024..4fdbcce 100644 --- a/components/printing/test/print_mock_render_thread.cc +++ b/components/printing/test/print_mock_render_thread.cc
@@ -59,7 +59,7 @@ IPC_MESSAGE_HANDLER(PrintHostMsg_UpdatePrintSettings, OnUpdatePrintSettings) IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetPrintedPagesCount, OnDidGetPrintedPagesCount) - IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintPage, OnDidPrintPage) + IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintDocument, OnDidPrintDocument) #if BUILDFLAG(ENABLE_PRINT_PREVIEW) IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetPreviewPageCount, OnDidGetPreviewPageCount) @@ -93,8 +93,8 @@ printer_->SetPrintedPagesCount(cookie, number_pages); } -void PrintMockRenderThread::OnDidPrintPage( - const PrintHostMsg_DidPrintPage_Params& params) { +void PrintMockRenderThread::OnDidPrintDocument( + const PrintHostMsg_DidPrintDocument_Params& params) { printer_->PrintPage(params); }
diff --git a/components/printing/test/print_mock_render_thread.h b/components/printing/test/print_mock_render_thread.h index f5d3e28..d8e08d4 100644 --- a/components/printing/test/print_mock_render_thread.h +++ b/components/printing/test/print_mock_render_thread.h
@@ -24,7 +24,7 @@ class MockPrinter; struct PrintHostMsg_DidGetPreviewPageCount_Params; struct PrintHostMsg_DidPreviewPage_Params; -struct PrintHostMsg_DidPrintPage_Params; +struct PrintHostMsg_DidPrintDocument_Params; struct PrintHostMsg_ScriptedPrint_Params; struct PrintMsg_PrintPages_Params; struct PrintMsg_Print_Params; @@ -72,7 +72,7 @@ PrintMsg_PrintPages_Params* settings); void OnDidGetPrintedPagesCount(int cookie, int number_pages); - void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params); + void OnDidPrintDocument(const PrintHostMsg_DidPrintDocument_Params& params); #if BUILDFLAG(ENABLE_PRINT_PREVIEW) void OnDidGetPreviewPageCount( const PrintHostMsg_DidGetPreviewPageCount_Params& params);
diff --git a/components/printing/test/print_render_frame_helper_browsertest.cc b/components/printing/test/print_render_frame_helper_browsertest.cc index 224c0a1..1fb7b38 100644 --- a/components/printing/test/print_render_frame_helper_browsertest.cc +++ b/components/printing/test/print_render_frame_helper_browsertest.cc
@@ -219,9 +219,9 @@ void VerifyPrintedPageSize(const gfx::Size& expected_page_size) { const IPC::Message* print_msg = render_thread_->sink().GetUniqueMessageMatching( - PrintHostMsg_DidPrintPage::ID); - PrintHostMsg_DidPrintPage::Param post_did_print_page_param; - PrintHostMsg_DidPrintPage::Read(print_msg, &post_did_print_page_param); + PrintHostMsg_DidPrintDocument::ID); + PrintHostMsg_DidPrintDocument::Param post_did_print_page_param; + PrintHostMsg_DidPrintDocument::Read(print_msg, &post_did_print_page_param); gfx::Size page_size_received = std::get<0>(post_did_print_page_param).page_size; EXPECT_EQ(expected_page_size, page_size_received); @@ -232,13 +232,13 @@ void VerifyPagesPrinted(bool expect_printed) { const IPC::Message* print_msg = render_thread_->sink().GetUniqueMessageMatching( - PrintHostMsg_DidPrintPage::ID); + PrintHostMsg_DidPrintDocument::ID); bool did_print = !!print_msg; ASSERT_EQ(expect_printed, did_print); if (did_print) { - PrintHostMsg_DidPrintPage::Param post_did_print_page_param; - PrintHostMsg_DidPrintPage::Read(print_msg, &post_did_print_page_param); - EXPECT_EQ(0, std::get<0>(post_did_print_page_param).page_number); + PrintHostMsg_DidPrintDocument::Param post_did_print_page_param; + PrintHostMsg_DidPrintDocument::Read(print_msg, + &post_did_print_page_param); } }
diff --git a/components/update_client/action_runner.cc b/components/update_client/action_runner.cc index 058750b..e357a11 100644 --- a/components/update_client/action_runner.cc +++ b/components/update_client/action_runner.cc
@@ -15,15 +15,14 @@ #include "base/logging.h" #include "base/task_scheduler/post_task.h" #include "components/update_client/component.h" +#include "components/update_client/configurator.h" #include "components/update_client/task_traits.h" #include "components/update_client/update_client.h" namespace update_client { -ActionRunner::ActionRunner(const Component& component, - const std::vector<uint8_t>& key_hash) +ActionRunner::ActionRunner(const Component& component) : component_(component), - key_hash_(key_hash), main_task_runner_(base::ThreadTaskRunnerHandle::Get()) {} ActionRunner::~ActionRunner() { @@ -46,7 +45,9 @@ base::FilePath file_path; installer->GetInstalledFile(component_.action_run(), &file_path); - auto unpacker = base::MakeRefCounted<ComponentUnpacker>(key_hash_, file_path, + // Contains the key hash of the CRX this object is allowed to run. + const auto key_hash = component_.config()->GetRunActionKeyHash(); + auto unpacker = base::MakeRefCounted<ComponentUnpacker>(key_hash, file_path, installer, nullptr); unpacker->Unpack( base::BindOnce(&ActionRunner::UnpackComplete, base::Unretained(this)));
diff --git a/components/update_client/action_runner.h b/components/update_client/action_runner.h index 075507d..877d9c2 100644 --- a/components/update_client/action_runner.h +++ b/components/update_client/action_runner.h
@@ -32,8 +32,7 @@ using Callback = base::OnceCallback<void(bool succeeded, int error_code, int extra_code1)>; - ActionRunner(const Component& component, - const std::vector<uint8_t>& key_hash); + explicit ActionRunner(const Component& component); ~ActionRunner(); void Run(Callback run_complete); @@ -50,10 +49,6 @@ const Component& component_; - // Contains the key hash of the CRX this object is allowed to run. This value - // is using during the unpacking of the CRX to verify its integrity. - const std::vector<uint8_t> key_hash_; - // Used to post callbacks to the main thread. scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
diff --git a/components/update_client/action_runner_win.cc b/components/update_client/action_runner_win.cc index 0008494..5115b9d 100644 --- a/components/update_client/action_runner_win.cc +++ b/components/update_client/action_runner_win.cc
@@ -14,6 +14,8 @@ #include "base/process/process.h" #include "base/single_thread_task_runner.h" #include "base/task_scheduler/post_task.h" +#include "components/update_client/component.h" +#include "components/update_client/configurator.h" #include "components/update_client/task_traits.h" namespace { @@ -49,7 +51,12 @@ base::CommandLine ActionRunner::MakeCommandLine( const base::FilePath& unpack_path) const { - return base::CommandLine(unpack_path.Append(kRecoveryFileName)); + base::CommandLine command_line(unpack_path.Append(kRecoveryFileName)); + if (!component_.config()->IsPerUserInstall()) + command_line.AppendSwitch("system"); + command_line.AppendSwitchASCII( + "browser-version", component_.config()->GetBrowserVersion().GetString()); + return command_line; } } // namespace update_client
diff --git a/components/update_client/component.cc b/components/update_client/component.cc index 9075541..28d7ee1 100644 --- a/components/update_client/component.cc +++ b/components/update_client/component.cc
@@ -174,6 +174,10 @@ Component::~Component() {} +scoped_refptr<Configurator> Component::config() const { + return update_context_.config; +} + void Component::Handle(CallbackHandleComplete callback) { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(state_); @@ -756,9 +760,7 @@ DCHECK(thread_checker_.CalledOnValidThread()); const auto& component = State::component(); - action_runner_ = base::MakeUnique<ActionRunner>( - component, component.update_context_.config->GetRunActionKeyHash()); - + action_runner_ = base::MakeUnique<ActionRunner>(component); action_runner_->Run( base::BindOnce(&StateRun::ActionRunComplete, base::Unretained(this))); }
diff --git a/components/update_client/component.h b/components/update_client/component.h index 34cde414..e577a8e7 100644 --- a/components/update_client/component.h +++ b/components/update_client/component.h
@@ -28,6 +28,7 @@ namespace update_client { class ActionRunner; +class Configurator; struct CrxUpdateItem; struct UpdateContext; @@ -119,6 +120,8 @@ std::string action_run() const { return action_run_; } + scoped_refptr<Configurator> config() const; + private: friend class FakePingManagerImpl; friend class UpdateCheckerTest;
diff --git a/content/renderer/media/media_permission_dispatcher.cc b/content/renderer/media/media_permission_dispatcher.cc index 91af4d0..64edff8c 100644 --- a/content/renderer/media/media_permission_dispatcher.cc +++ b/content/renderer/media/media_permission_dispatcher.cc
@@ -68,17 +68,14 @@ OnConnectionError(); } -// TODO(crbug.com/793684): |security_origin| is no longer used; remove it. void MediaPermissionDispatcher::HasPermission( Type type, - const GURL& security_origin, const PermissionStatusCB& permission_status_cb) { if (!task_runner_->RunsTasksInCurrentSequence()) { task_runner_->PostTask( FROM_HERE, base::BindOnce(&MediaPermissionDispatcher::HasPermission, weak_ptr_, - type, security_origin, - media::BindToCurrentLoop(permission_status_cb))); + type, media::BindToCurrentLoop(permission_status_cb))); return; } @@ -93,17 +90,14 @@ request_id)); } -// TODO(crbug.com/793684): |security_origin| is no longer used; remove it. void MediaPermissionDispatcher::RequestPermission( Type type, - const GURL& security_origin, const PermissionStatusCB& permission_status_cb) { if (!task_runner_->RunsTasksInCurrentSequence()) { task_runner_->PostTask( FROM_HERE, base::BindOnce(&MediaPermissionDispatcher::RequestPermission, weak_ptr_, - type, security_origin, - media::BindToCurrentLoop(permission_status_cb))); + type, media::BindToCurrentLoop(permission_status_cb))); return; }
diff --git a/content/renderer/media/media_permission_dispatcher.h b/content/renderer/media/media_permission_dispatcher.h index 583bf80f..64e7867 100644 --- a/content/renderer/media/media_permission_dispatcher.h +++ b/content/renderer/media/media_permission_dispatcher.h
@@ -42,11 +42,9 @@ // Note: Can be called on any thread. The |permission_status_cb| will always // be fired on the thread where these methods are called. void HasPermission(Type type, - const GURL& security_origin, const PermissionStatusCB& permission_status_cb) override; void RequestPermission( Type type, - const GURL& security_origin, const PermissionStatusCB& permission_status_cb) override; bool IsEncryptedMediaEnabled() override;
diff --git a/content/renderer/p2p/filtering_network_manager.cc b/content/renderer/p2p/filtering_network_manager.cc index 0585f29..f8b2ec4 100644 --- a/content/renderer/p2p/filtering_network_manager.cc +++ b/content/renderer/p2p/filtering_network_manager.cc
@@ -101,10 +101,10 @@ VLOG(1) << "FilteringNetworkManager checking permission status."; // Request for media permission asynchronously. media_permission_->HasPermission( - media::MediaPermission::AUDIO_CAPTURE, requesting_origin_, + media::MediaPermission::AUDIO_CAPTURE, base::Bind(&FilteringNetworkManager::OnPermissionStatus, GetWeakPtr())); media_permission_->HasPermission( - media::MediaPermission::VIDEO_CAPTURE, requesting_origin_, + media::MediaPermission::VIDEO_CAPTURE, base::Bind(&FilteringNetworkManager::OnPermissionStatus, GetWeakPtr())); }
diff --git a/content/renderer/p2p/filtering_network_manager_unittest.cc b/content/renderer/p2p/filtering_network_manager_unittest.cc index bb0e994f..7bd8e49 100644 --- a/content/renderer/p2p/filtering_network_manager_unittest.cc +++ b/content/renderer/p2p/filtering_network_manager_unittest.cc
@@ -82,13 +82,11 @@ void RequestPermission( Type type, - const GURL& security_origin, const PermissionStatusCB& permission_status_cb) override { NOTIMPLEMENTED(); } void HasPermission(Type type, - const GURL& security_origin, const PermissionStatusCB& permission_status_cb) override { if (type == MediaPermission::AUDIO_CAPTURE) { DCHECK(mic_callback_.is_null());
diff --git a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc index 958d7f33..96b3648 100644 --- a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc +++ b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
@@ -132,6 +132,13 @@ } void LayoutTestContentRendererClient::RenderThreadStarted() { +// Unless/until WebM files are added to the media layout tests, we need to +// avoid removing MP4/H264/AAC so that layout tests can run on Android. +// TODO(chcunningham): We should fix the tests to always use non-proprietary +// codecs and just delete this code. http://crbug.com/787575 +#if !defined(OS_ANDROID) + media::RemoveProprietaryMediaTypesAndCodecsForTests(); +#endif ShellContentRendererClient::RenderThreadStarted(); shell_observer_.reset(new LayoutTestRenderThreadObserver()); }
diff --git a/extensions/browser/api/feedback_private/feedback_private_api_unittest_base_chromeos.cc b/extensions/browser/api/feedback_private/feedback_private_api_unittest_base_chromeos.cc index cdbe136..eabf9313 100644 --- a/extensions/browser/api/feedback_private/feedback_private_api_unittest_base_chromeos.cc +++ b/extensions/browser/api/feedback_private/feedback_private_api_unittest_base_chromeos.cc
@@ -49,7 +49,7 @@ // sequence: "a", " bb", " ccc", until 25 spaces followed by 26 z's. After // that, it returns |kDummyMacAddress| before repeating the entire process. // It will never return an empty result. - void Fetch(const system_logs::SysLogsSourceCallback& callback) override { + void Fetch(system_logs::SysLogsSourceCallback callback) override { std::string result = GetNextLogResult(); DCHECK_GT(result.size(), 0U); @@ -60,7 +60,7 @@ // log sources actually work. Instead, simulate the asynchronous operation // of a SystemLogsSource by invoking the callback separately. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::BindOnce(callback, std::move(result_map))); + FROM_HERE, base::BindOnce(std::move(callback), std::move(result_map))); } private:
diff --git a/extensions/browser/api/feedback_private/log_source_access_manager.cc b/extensions/browser/api/feedback_private/log_source_access_manager.cc index 8e0036c..e709b041 100644 --- a/extensions/browser/api/feedback_private/log_source_access_manager.cc +++ b/extensions/browser/api/feedback_private/log_source_access_manager.cc
@@ -86,10 +86,9 @@ g_rate_limiting_timeout = timeout; } -bool LogSourceAccessManager::FetchFromSource( - const ReadLogSourceParams& params, - const std::string& extension_id, - const ReadLogSourceCallback& callback) { +bool LogSourceAccessManager::FetchFromSource(const ReadLogSourceParams& params, + const std::string& extension_id, + ReadLogSourceCallback callback) { int requested_resource_id = params.reader_id ? *params.reader_id : kInvalidResourceId; ApiResourceManager<LogSourceResource>* resource_manager = @@ -113,7 +112,7 @@ // perspective, there is no new data. There is no need for the caller to keep // track of the time since last access. if (!UpdateSourceAccessTime(resource_id)) { - callback.Run( + std::move(callback).Run( std::make_unique<api::feedback_private::ReadLogSourceResult>()); return true; } @@ -124,9 +123,10 @@ // later access indicates that the source should be closed afterwards. const bool delete_resource_when_done = !params.incremental; - resource->GetLogSource()->Fetch(base::Bind( - &LogSourceAccessManager::OnFetchComplete, weak_factory_.GetWeakPtr(), - extension_id, resource_id, delete_resource_when_done, callback)); + resource->GetLogSource()->Fetch( + base::BindOnce(&LogSourceAccessManager::OnFetchComplete, + weak_factory_.GetWeakPtr(), extension_id, resource_id, + delete_resource_when_done, std::move(callback))); return true; } @@ -134,7 +134,7 @@ const std::string& extension_id, ResourceId resource_id, bool delete_resource, - const ReadLogSourceCallback& callback, + ReadLogSourceCallback callback, std::unique_ptr<SystemLogsResponse> response) { auto result = std::make_unique<ReadLogSourceResult>(); @@ -151,7 +151,7 @@ FROM_HERE, base::BindOnce(AnonymizeResults, anonymizer_container_, base::Unretained(result_ptr)), - base::BindOnce(callback, std::move(result))); + base::BindOnce(std::move(callback), std::move(result))); if (delete_resource) { // This should also remove the entry from |sources_|.
diff --git a/extensions/browser/api/feedback_private/log_source_access_manager.h b/extensions/browser/api/feedback_private/log_source_access_manager.h index 62563a5..1b883362 100644 --- a/extensions/browser/api/feedback_private/log_source_access_manager.h +++ b/extensions/browser/api/feedback_private/log_source_access_manager.h
@@ -30,7 +30,7 @@ // - A source may not be accessed too frequently by an extension. class LogSourceAccessManager { public: - using ReadLogSourceCallback = base::Callback<void( + using ReadLogSourceCallback = base::OnceCallback<void( std::unique_ptr<api::feedback_private::ReadLogSourceResult>)>; explicit LogSourceAccessManager(content::BrowserContext* context); @@ -52,7 +52,7 @@ // feedback_private.idl for more info about the actual parameters. bool FetchFromSource(const api::feedback_private::ReadLogSourceParams& params, const std::string& extension_id, - const ReadLogSourceCallback& callback); + ReadLogSourceCallback callback); // Each log source may not have more than this number of readers accessing it, // regardless of extension. @@ -111,7 +111,7 @@ const std::string& extension_id, ResourceId resource_id, bool delete_source, - const ReadLogSourceCallback& callback, + ReadLogSourceCallback callback, std::unique_ptr<system_logs::SystemLogsResponse> response); // Removes an existing log source handle indicated by |id| from
diff --git a/extensions/browser/api/feedback_private/log_source_access_manager_chromeos_unittest.cc b/extensions/browser/api/feedback_private/log_source_access_manager_chromeos_unittest.cc index 449eef40..16494ca7 100644 --- a/extensions/browser/api/feedback_private/log_source_access_manager_chromeos_unittest.cc +++ b/extensions/browser/api/feedback_private/log_source_access_manager_chromeos_unittest.cc
@@ -21,6 +21,8 @@ constexpr int kMaxReadersPerSource = LogSourceAccessManager::kMaxReadersPerSource; +void DummyCallback(std::unique_ptr<ReadLogSourceResult>) {} + } // namespace using LogSourceAccessManagerTest = FeedbackPrivateApiUnittestBase; @@ -31,10 +33,6 @@ LogSourceAccessManager manager(browser_context()); - // Create a dummy callback to pass to FetchFromSource(). - LogSourceAccessManager::ReadLogSourceCallback callback = - base::Bind([](std::unique_ptr<ReadLogSourceResult>) {}); - const std::string extension_id = "extension"; // Open 10 readers for LOG_SOURCE_MESSAGES from the same extension. @@ -42,8 +40,8 @@ messages_params.incremental = false; messages_params.source = LOG_SOURCE_MESSAGES; for (size_t i = 0; i < kMaxReadersPerSource; ++i) { - EXPECT_TRUE( - manager.FetchFromSource(messages_params, extension_id, callback)) + EXPECT_TRUE(manager.FetchFromSource(messages_params, extension_id, + base::BindOnce(&DummyCallback))) << base::StringPrintf("Unable to read from log source with i=%zu", i); EXPECT_EQ(i + 1, manager.GetNumActiveResourcesForSource(LOG_SOURCE_MESSAGES)); @@ -55,8 +53,8 @@ ui_latest_params.incremental = false; ui_latest_params.source = LOG_SOURCE_UILATEST; for (size_t i = 0; i < kMaxReadersPerSource; ++i) { - EXPECT_TRUE( - manager.FetchFromSource(ui_latest_params, extension_id, callback)) + EXPECT_TRUE(manager.FetchFromSource(ui_latest_params, extension_id, + base::BindOnce(&DummyCallback))) << base::StringPrintf("Unable to read from log source with i=%zu", i); EXPECT_EQ(i + 1, manager.GetNumActiveResourcesForSource(LOG_SOURCE_UILATEST)); @@ -64,10 +62,10 @@ EXPECT_EQ(10U, manager.GetNumActiveResourcesForSource(LOG_SOURCE_MESSAGES)); // Can't open more readers for LOG_SOURCE_MESSAGES or LOG_SOURCE_UILATEST. - EXPECT_FALSE( - manager.FetchFromSource(messages_params, extension_id, callback)); - EXPECT_FALSE( - manager.FetchFromSource(ui_latest_params, extension_id, callback)); + EXPECT_FALSE(manager.FetchFromSource(messages_params, extension_id, + base::BindOnce(&DummyCallback))); + EXPECT_FALSE(manager.FetchFromSource(ui_latest_params, extension_id, + base::BindOnce(&DummyCallback))); EXPECT_EQ(10U, manager.GetNumActiveResourcesForSource(LOG_SOURCE_MESSAGES)); EXPECT_EQ(10U, manager.GetNumActiveResourcesForSource(LOG_SOURCE_UILATEST)); @@ -82,10 +80,6 @@ LogSourceAccessManager manager(browser_context()); - // Create a dummy callback to pass to FetchFromSource(). - LogSourceAccessManager::ReadLogSourceCallback callback = - base::Bind([](std::unique_ptr<ReadLogSourceResult>) {}); - int count = 0; // Open 10 readers for LOG_SOURCE_MESSAGES from different extensions. @@ -94,7 +88,8 @@ messages_params.source = LOG_SOURCE_MESSAGES; for (size_t i = 0; i < kMaxReadersPerSource; ++i, ++count) { EXPECT_TRUE(manager.FetchFromSource( - messages_params, base::StringPrintf("extension %d", count), callback)) + messages_params, base::StringPrintf("extension %d", count), + base::BindOnce(&DummyCallback))) << base::StringPrintf( "Unable to read from log source with i=%zu and count=%d", i, count); @@ -109,7 +104,8 @@ ui_latest_params.source = LOG_SOURCE_UILATEST; for (size_t i = 0; i < kMaxReadersPerSource; ++i, ++count) { EXPECT_TRUE(manager.FetchFromSource( - ui_latest_params, base::StringPrintf("extension %d", count), callback)) + ui_latest_params, base::StringPrintf("extension %d", count), + base::BindOnce(&DummyCallback))) << base::StringPrintf( "Unable to read from log source with i=%zu and count=%d", i, count); @@ -120,13 +116,15 @@ // Can't open more readers for LOG_SOURCE_MESSAGES. EXPECT_FALSE(manager.FetchFromSource( - messages_params, base::StringPrintf("extension %d", count), callback)); + messages_params, base::StringPrintf("extension %d", count), + base::BindOnce(&DummyCallback))); EXPECT_EQ(10U, manager.GetNumActiveResourcesForSource(LOG_SOURCE_MESSAGES)); EXPECT_EQ(10U, manager.GetNumActiveResourcesForSource(LOG_SOURCE_UILATEST)); // Can't open more readers for LOG_SOURCE_UILATEST. EXPECT_FALSE(manager.FetchFromSource( - ui_latest_params, base::StringPrintf("extension %d", count), callback)); + ui_latest_params, base::StringPrintf("extension %d", count), + base::BindOnce(&DummyCallback))); EXPECT_EQ(10U, manager.GetNumActiveResourcesForSource(LOG_SOURCE_MESSAGES)); EXPECT_EQ(10U, manager.GetNumActiveResourcesForSource(LOG_SOURCE_UILATEST));
diff --git a/extensions/shell/browser/system_logs/log_sources/basic_log_source.cc b/extensions/shell/browser/system_logs/log_sources/basic_log_source.cc index 8b176b09..26037e6 100644 --- a/extensions/shell/browser/system_logs/log_sources/basic_log_source.cc +++ b/extensions/shell/browser/system_logs/log_sources/basic_log_source.cc
@@ -32,7 +32,7 @@ BasicLogSource::~BasicLogSource() = default; -void BasicLogSource::Fetch(const SysLogsSourceCallback& callback) { +void BasicLogSource::Fetch(SysLogsSourceCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(!callback.is_null()); @@ -41,7 +41,7 @@ PopulateVersionStrings(response.get()); PopulateExtensionInfoLogs(response.get()); - callback.Run(std::move(response)); + std::move(callback).Run(std::move(response)); } void BasicLogSource::PopulateVersionStrings(SystemLogsResponse* response) {
diff --git a/extensions/shell/browser/system_logs/log_sources/basic_log_source.h b/extensions/shell/browser/system_logs/log_sources/basic_log_source.h index c5fa0e2..5b43d47 100644 --- a/extensions/shell/browser/system_logs/log_sources/basic_log_source.h +++ b/extensions/shell/browser/system_logs/log_sources/basic_log_source.h
@@ -21,7 +21,7 @@ ~BasicLogSource() override; // SystemLogsSource: - void Fetch(const SysLogsSourceCallback& request) override; + void Fetch(SysLogsSourceCallback request) override; private: void PopulateVersionStrings(SystemLogsResponse* response);
diff --git a/headless/lib/browser/headless_print_manager.cc b/headless/lib/browser/headless_print_manager.cc index df3b27c..c4acd8c 100644 --- a/headless/lib/browser/headless_print_manager.cc +++ b/headless/lib/browser/headless_print_manager.cc
@@ -66,8 +66,6 @@ return "Invalid memory handle"; case METAFILE_MAP_ERROR: return "Map to shared memory error"; - case UNEXPECTED_VALID_MEMORY_HANDLE: - return "Unexpected valide memory handle"; case METAFILE_INVALID_HEADER: return "Invalid metafile header"; case METAFILE_GET_DATA_ERROR: @@ -238,7 +236,7 @@ IPC_BEGIN_MESSAGE_MAP(HeadlessPrintManager, message) IPC_MESSAGE_HANDLER(PrintHostMsg_ShowInvalidPrinterSettingsError, OnShowInvalidPrinterSettingsError) - IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintPage, OnDidPrintPage) + IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintDocument, OnDidPrintDocument) IPC_MESSAGE_FORWARD_DELAY_REPLY( PrintHostMsg_GetDefaultPrintSettings, &helper, FrameDispatchHelper::OnGetDefaultPrintSettings) @@ -288,41 +286,21 @@ ReleaseJob(PRINTING_FAILED); } -void HeadlessPrintManager::OnDidGetPrintedPagesCount(int cookie, - int number_pages) { - PrintManager::OnDidGetPrintedPagesCount(cookie, number_pages); - if (!print_params_->pages.empty()) - number_pages_ = print_params_->pages.size(); -} - -void HeadlessPrintManager::OnDidPrintPage( - const PrintHostMsg_DidPrintPage_Params& params) { - const bool metafile_must_be_valid = expecting_first_page_; - expecting_first_page_ = false; - - if (metafile_must_be_valid) { - if (!base::SharedMemory::IsHandleValid(params.metafile_data_handle)) { - ReleaseJob(INVALID_MEMORY_HANDLE); - return; - } - auto shared_buf = - std::make_unique<base::SharedMemory>(params.metafile_data_handle, true); - if (!shared_buf->Map(params.data_size)) { - ReleaseJob(METAFILE_MAP_ERROR); - return; - } - data_ = std::string(static_cast<const char*>(shared_buf->memory()), - params.data_size); - } else { - if (base::SharedMemory::IsHandleValid(params.metafile_data_handle)) { - base::SharedMemory::CloseHandle(params.metafile_data_handle); - ReleaseJob(UNEXPECTED_VALID_MEMORY_HANDLE); - return; - } +void HeadlessPrintManager::OnDidPrintDocument( + const PrintHostMsg_DidPrintDocument_Params& params) { + if (!base::SharedMemory::IsHandleValid(params.metafile_data_handle)) { + ReleaseJob(INVALID_MEMORY_HANDLE); + return; } - - if (--number_pages_ == 0) - ReleaseJob(PRINT_SUCCESS); + auto shared_buf = + std::make_unique<base::SharedMemory>(params.metafile_data_handle, true); + if (!shared_buf->Map(params.data_size)) { + ReleaseJob(METAFILE_MAP_ERROR); + return; + } + data_ = std::string(static_cast<const char*>(shared_buf->memory()), + params.data_size); + ReleaseJob(PRINT_SUCCESS); } void HeadlessPrintManager::Reset() { @@ -332,8 +310,6 @@ page_ranges_text_.clear(); ignore_invalid_page_ranges_ = false; data_.clear(); - expecting_first_page_ = true; - number_pages_ = 0; } void HeadlessPrintManager::ReleaseJob(PrintResult result) {
diff --git a/headless/lib/browser/headless_print_manager.h b/headless/lib/browser/headless_print_manager.h index 1671d59d..4173b92b 100644 --- a/headless/lib/browser/headless_print_manager.h +++ b/headless/lib/browser/headless_print_manager.h
@@ -15,7 +15,7 @@ #include "headless/public/headless_export.h" #include "printing/print_settings.h" -struct PrintHostMsg_DidPrintPage_Params; +struct PrintHostMsg_DidPrintDocument_Params; struct PrintHostMsg_ScriptedPrint_Params; struct PrintMsg_PrintPages_Params; @@ -48,7 +48,6 @@ INVALID_PRINTER_SETTINGS, INVALID_MEMORY_HANDLE, METAFILE_MAP_ERROR, - UNEXPECTED_VALID_MEMORY_HANDLE, METAFILE_INVALID_HEADER, METAFILE_GET_DATA_ERROR, SIMULTANEOUS_PRINT_ACTIVE, @@ -101,8 +100,7 @@ IPC::Message* reply_msg); void OnShowInvalidPrinterSettingsError(); void OnPrintingFailed(int cookie) override; - void OnDidGetPrintedPagesCount(int cookie, int number_pages) override; - void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params); + void OnDidPrintDocument(const PrintHostMsg_DidPrintDocument_Params& params); void Reset(); void ReleaseJob(PrintResult result); @@ -114,9 +112,6 @@ bool ignore_invalid_page_ranges_ = false; std::string data_; - // Set to true when OnDidPrintPage() should be expecting the first page. - bool expecting_first_page_ = true; - DISALLOW_COPY_AND_ASSIGN(HeadlessPrintManager); };
diff --git a/ios/chrome/browser/passwords/credential_manager_unittest.mm b/ios/chrome/browser/passwords/credential_manager_unittest.mm index c3d0016..f95ecc36 100644 --- a/ios/chrome/browser/passwords/credential_manager_unittest.mm +++ b/ios/chrome/browser/passwords/credential_manager_unittest.mm
@@ -179,7 +179,6 @@ ssl.security_style = security_style; ssl.certificate = cert; ssl.cert_status = cert_status; - ssl.connection_status = net::SSL_CONNECTION_VERSION_SSL3; ssl.content_status = content_status; ssl.cert_status_host = kHostName; }
diff --git a/ios/chrome/browser/ssl/ios_security_state_tab_helper.mm b/ios/chrome/browser/ssl/ios_security_state_tab_helper.mm index 68659a69..9e48b34 100644 --- a/ios/chrome/browser/ssl/ios_security_state_tab_helper.mm +++ b/ios/chrome/browser/ssl/ios_security_state_tab_helper.mm
@@ -52,7 +52,6 @@ const web::SSLStatus& ssl = item->GetSSL(); state->certificate = ssl.certificate; state->cert_status = ssl.cert_status; - state->connection_status = ssl.connection_status; state->displayed_mixed_content = (ssl.content_status & web::SSLStatus::DISPLAYED_INSECURE_CONTENT) ? true : false;
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.h b/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.h index 0b0dab1..def8359 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.h +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.h
@@ -48,6 +48,9 @@ - (ToolbarButton*)voiceSearchButton; // ContractToolbar ToolbarButton. - (ToolbarButton*)contractToolbarButton; +// LocationBar LeadingButton. Currently used for the incognito icon when the +// Toolbar is expanded on incognito mode. It can return nil. +- (ToolbarButton*)locationBarLeadingButton; // Returns images for Voice Search in an array representing the NORMAL/PRESSED // state
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.mm index 35aa4b2..4d3fbb8 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.mm +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.mm
@@ -236,6 +236,20 @@ return contractToolbarButton; } +- (ToolbarButton*)locationBarLeadingButton { + ToolbarButton* locationBarLeadingButton; + if (self.style == INCOGNITO) { + locationBarLeadingButton = [ToolbarButton + toolbarButtonWithImageForNormalState: + [UIImage imageNamed:@"incognito_marker_typing"] + imageForHighlightedState:nil + imageForDisabledState: + [UIImage imageNamed:@"incognito_marker_typing"]]; + locationBarLeadingButton.enabled = NO; + } + return locationBarLeadingButton; +} + #pragma mark - Helpers - (NSArray<UIImage*>*)voiceSearchImages {
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_constants.h b/ios/chrome/browser/ui/toolbar/clean/toolbar_constants.h index 8dc06fa..3455e3d7 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_constants.h +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_constants.h
@@ -41,12 +41,14 @@ // Toolbar Buttons. extern const CGFloat kToolsMenuButtonWidth; extern const CGFloat kToolbarButtonWidth; +extern const CGFloat kLeadingLocationBarButtonWidth; extern const CGFloat kToolbarButtonTitleNormalColor; extern const CGFloat kToolbarButtonTitleHighlightedColor; extern const CGFloat kIncognitoToolbarButtonTitleNormalColor; extern const CGFloat kIncognitoToolbarButtonTitleHighlightedColor; extern const CGFloat kBackButtonImageInset; extern const CGFloat kForwardButtonImageInset; +extern const CGFloat kLeadingLocationBarButtonImageInset; // Maximum number of tabs displayed by the button containing the tab count. extern const NSInteger kShowTabStripButtonMaxTabCount;
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_constants.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_constants.mm index 37b5078..ce3e7e2 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_constants.mm +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_constants.mm
@@ -29,6 +29,7 @@ const CGFloat kToolsMenuButtonWidth = 44.0f; const CGFloat kToolbarButtonWidth = 48.0f; +const CGFloat kLeadingLocationBarButtonWidth = 40.0f; const CGFloat kToolbarButtonTitleNormalColor = 0x555555; const CGFloat kIncognitoLocationBarBorderColor = 0x4C4C4C; const CGFloat kToolbarButtonTitleHighlightedColor = 0x4285F4; @@ -36,6 +37,7 @@ const CGFloat kIncognitoToolbarButtonTitleHighlightedColor = 0x888a8c; const CGFloat kBackButtonImageInset = -9; const CGFloat kForwardButtonImageInset = -7; +const CGFloat kLeadingLocationBarButtonImageInset = 15; const NSInteger kShowTabStripButtonMaxTabCount = 99;
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm index 6b87567..4b55dbf 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm
@@ -57,6 +57,7 @@ @property(nonatomic, strong) ToolbarButton* voiceSearchButton; @property(nonatomic, strong) ToolbarButton* bookmarkButton; @property(nonatomic, strong) ToolbarButton* contractButton; +@property(nonatomic, strong) ToolbarButton* locationBarLeadingButton; @property(nonatomic, assign) BOOL voiceSearchEnabled; @property(nonatomic, strong) MDCProgressView* progressBar; @property(nonatomic, strong) UIStackView* locationBarContainerStackView; @@ -111,6 +112,7 @@ @synthesize voiceSearchButton = _voiceSearchButton; @synthesize bookmarkButton = _bookmarkButton; @synthesize contractButton = _contractButton; +@synthesize locationBarLeadingButton = _locationBarLeadingButton; @synthesize voiceSearchEnabled = _voiceSearchEnabled; @synthesize progressBar = _progressBar; @synthesize locationBarContainerStackView = _locationBarContainerStackView; @@ -158,12 +160,12 @@ [self setHorizontalTranslationOffset: kToolbarButtonAnimationOffset - forButtons: + forViews: self.leadingStackViewButtons]; [self setHorizontalTranslationOffset: -kToolbarButtonAnimationOffset - forButtons: + forViews: self.trailingStackViewButtons]; [self setAllToolbarButtonsOpacity:0]; } @@ -175,11 +177,24 @@ self.fullBleedShadowView.alpha = 1; self.locationBarShadow.alpha = 0; }]; + + // If locationBarLeadingButton exists fade it in. + if (self.locationBarLeadingButton) { + [self setHorizontalTranslationOffset:-kToolbarButtonAnimationOffset + forViews:@[ self.locationBarLeadingButton ]]; + [animator addAnimations:^{ + [self setHorizontalTranslationOffset:0 + forViews:@[ self.locationBarLeadingButton ]]; + self.locationBarLeadingButton.alpha = 1; + } + delayFactor:ios::material::kDuration2]; + } + // When the locationBarContainer has been expanded the Contract button will // fade in. [animator addCompletion:^(UIViewAnimatingPosition finalPosition) { [self setHorizontalTranslationOffset:kToolbarButtonAnimationOffset - forButtons:@[ self.contractButton ]]; + forViews:@[ self.contractButton ]]; [UIViewPropertyAnimator runningPropertyAnimatorWithDuration:ios::material::kDuration1 @@ -189,9 +204,9 @@ self.contractButton.alpha = 1; [self setHorizontalTranslationOffset:0 - forButtons:@[ - self.contractButton - ]]; + forViews:@[ + self.contractButton + ]]; } completion:nil]; }]; @@ -208,6 +223,29 @@ - (void)addToolbarContractionAnimations:(UIViewPropertyAnimator*)animator { // iPad should never try to animate. DCHECK(!IsIPadIdiom()); + + // If locationBarLeadingButton exists fade it out before the rest of the + // Toolbar is contracted. + if (self.locationBarLeadingButton) { + [UIViewPropertyAnimator + runningPropertyAnimatorWithDuration:ios::material::kDuration2 + delay:0 + options:UIViewAnimationOptionCurveEaseIn + animations:^{ + self.locationBarLeadingButton.alpha = 0; + [self setHorizontalTranslationOffset:-kToolbarButtonAnimationOffset + forViews:@[ + self.locationBarLeadingButton + ]]; + } + completion:^(UIViewAnimatingPosition finalPosition) { + [self setHorizontalTranslationOffset:0 + forViews:@[ + self.locationBarLeadingButton + ]]; + }]; + } + [NSLayoutConstraint deactivateConstraints:self.expandedToolbarConstraints]; [NSLayoutConstraint activateConstraints:self.regularToolbarConstraints]; // Change the Toolbar buttons opacity to 0 since these will fade in once the @@ -221,13 +259,15 @@ self.shadowView.alpha = 1; self.fullBleedShadowView.alpha = 0; self.locationBarShadow.alpha = 1; + self.locationBarLeadingButton.hidden = YES; }]; + // Once the locationBarContainer has been contracted fade in ToolbarButtons. [animator addCompletion:^(UIViewAnimatingPosition finalPosition) { [self setHorizontalTranslationOffset:kToolbarButtonAnimationOffset - forButtons:self.leadingStackViewButtons]; + forViews:self.leadingStackViewButtons]; [self setHorizontalTranslationOffset:-kToolbarButtonAnimationOffset - forButtons:self.trailingStackViewButtons]; + forViews:self.trailingStackViewButtons]; [UIViewPropertyAnimator runningPropertyAnimatorWithDuration:ios::material::kDuration1 delay:ios::material::kDuration4 @@ -236,12 +276,12 @@ [self.view layoutIfNeeded]; [self setHorizontalTranslationOffset:0 - forButtons: - self.leadingStackViewButtons]; + forViews: + self.leadingStackViewButtons]; [self setHorizontalTranslationOffset:0 - forButtons: - self.trailingStackViewButtons]; + forViews: + self.trailingStackViewButtons]; [self setAllToolbarButtonsOpacity:1]; } completion:nil]; @@ -364,6 +404,12 @@ } else { [self.locationBarContainerStackView addArrangedSubview:self.contractButton]; } + // If |self.locationBarLeadingButton| exists add it to the StackView. + if (self.locationBarLeadingButton) { + [self.locationBarContainerStackView + insertArrangedSubview:self.locationBarLeadingButton + atIndex:0]; + } [self.locationBarContainer addSubview:self.locationBarContainerStackView]; } @@ -460,24 +506,8 @@ [self.regularToolbarConstraints addObjectsFromArray:locationBarRegularConstraints]; [NSLayoutConstraint activateConstraints:locationBarRegularConstraints]; - - // LocationBarStackView constraints. The StackView inside the - // LocationBarContainer View. - UILayoutGuide* locationBarContainerSafeAreaGuide = - SafeAreaLayoutGuideForView(self.locationBarContainer); - NSLayoutConstraint* locationBarContainerStackViewTopConstraint = - [self.locationBarContainerStackView.topAnchor - constraintEqualToAnchor:self.locationBarContainer.topAnchor]; + // LocationBarContainer shadow constraints. [NSLayoutConstraint activateConstraints:@[ - [self.locationBarContainerStackView.bottomAnchor - constraintEqualToAnchor:self.locationBarContainer.bottomAnchor], - [self.locationBarContainerStackView.leadingAnchor - constraintEqualToAnchor:locationBarContainerSafeAreaGuide - .leadingAnchor], - [self.locationBarContainerStackView.trailingAnchor - constraintEqualToAnchor:locationBarContainerSafeAreaGuide - .trailingAnchor], - locationBarContainerStackViewTopConstraint, [self.locationBarShadow.heightAnchor constraintEqualToConstant:kLocationBarShadowHeight], [self.locationBarShadow.leadingAnchor @@ -490,6 +520,25 @@ constraintEqualToAnchor:self.locationBarContainer.bottomAnchor constant:-kLocationBarBorderWidth], ]]; + + // LocationBarStackView constraints. The StackView inside the + // LocationBarContainer View. + UILayoutGuide* locationBarContainerSafeAreaGuide = + SafeAreaLayoutGuideForView(self.locationBarContainer); + NSLayoutConstraint* locationBarContainerStackViewTopConstraint = + [self.locationBarContainerStackView.topAnchor + constraintEqualToAnchor:self.locationBarContainer.topAnchor]; + [NSLayoutConstraint activateConstraints:@[ + [self.locationBarContainerStackView.bottomAnchor + constraintEqualToAnchor:self.locationBarContainer.bottomAnchor], + [self.locationBarContainerStackView.trailingAnchor + constraintEqualToAnchor:locationBarContainerSafeAreaGuide + .trailingAnchor], + [self.locationBarContainerStackView.leadingAnchor + constraintEqualToAnchor:locationBarContainerSafeAreaGuide + .leadingAnchor], + locationBarContainerStackViewTopConstraint, + ]]; [self.regularToolbarConstraints addObject:locationBarContainerStackViewTopConstraint]; } @@ -655,6 +704,19 @@ setContentHuggingPriority:UILayoutPriorityDefaultLow forAxis:UILayoutConstraintAxisHorizontal]; self.locationBarContainer = locationBarContainer; + + // LocationBar LeadingButton + self.locationBarLeadingButton = [self.buttonFactory locationBarLeadingButton]; + self.locationBarLeadingButton.visibilityMask = + ToolbarComponentVisibilityCompactWidth | + ToolbarComponentVisibilityRegularWidth; + self.locationBarLeadingButton.alpha = 0; + self.locationBarLeadingButton.hidden = YES; + [self.locationBarLeadingButton.widthAnchor + constraintEqualToConstant:kLeadingLocationBarButtonWidth] + .active = YES; + self.locationBarLeadingButton.imageEdgeInsets = + UIEdgeInsetsMakeDirected(0, kLeadingLocationBarButtonImageInset, 0, 0); } - (void)setUpProgressBar { @@ -1007,13 +1069,14 @@ } } -// Offsets the horizontal translation transform of all visible Toolbar Buttons -// in |array| by |offset|. If the button is hidden it will assign the +// Offsets the horizontal translation transform of all visible UIViews +// in |array| by |offset|. If the View is hidden it will assign the // IdentityTransform. Used for fade in animations. - (void)setHorizontalTranslationOffset:(LayoutOffset)offset - forButtons:(NSArray<ToolbarButton*>*)array { - for (UIButton* button in array) { - button.transform = (offset != 0 && !button.hidden) + forViews:(NSArray<UIView*>*)array { + for (UIView* view in array) { + if (!view.hidden) + view.transform = (offset != 0 && !view.hidden) ? CGAffineTransformMakeTranslation(offset, 0) : CGAffineTransformIdentity; }
diff --git a/ios/web/public/ssl_status.cc b/ios/web/public/ssl_status.cc index c7513c6..1c0e0f6 100644 --- a/ios/web/public/ssl_status.cc +++ b/ios/web/public/ssl_status.cc
@@ -9,7 +9,6 @@ SSLStatus::SSLStatus() : security_style(SECURITY_STYLE_UNKNOWN), cert_status(0), - connection_status(0), content_status(NORMAL_CONTENT) { } @@ -17,7 +16,6 @@ : security_style(other.security_style), certificate(other.certificate), cert_status(other.cert_status), - connection_status(other.connection_status), content_status(other.content_status), cert_status_host(other.cert_status_host), user_data(other.user_data ? other.user_data->Clone() : nullptr) {} @@ -26,7 +24,6 @@ security_style = other.security_style; certificate = other.certificate; cert_status = other.cert_status; - connection_status = other.connection_status; content_status = other.content_status; cert_status_host = other.cert_status_host; user_data = other.user_data ? other.user_data->Clone() : nullptr;
diff --git a/ios/web/public/ssl_status.h b/ios/web/public/ssl_status.h index 1c5df45..500281a 100644 --- a/ios/web/public/ssl_status.h +++ b/ios/web/public/ssl_status.h
@@ -61,7 +61,6 @@ web::SecurityStyle security_style; scoped_refptr<net::X509Certificate> certificate; net::CertStatus cert_status; - int connection_status; // A combination of the ContentStatusFlags above. int content_status; // Host which was used for |cert_status| calculation. It is not an actual part
diff --git a/ios/web/public/ssl_status_unittest.cc b/ios/web/public/ssl_status_unittest.cc index 53588a8f..19a0529 100644 --- a/ios/web/public/ssl_status_unittest.cc +++ b/ios/web/public/ssl_status_unittest.cc
@@ -36,7 +36,6 @@ SSLStatus status; EXPECT_EQ(SECURITY_STYLE_UNKNOWN, status.security_style); EXPECT_EQ(0u, status.cert_status); - EXPECT_EQ(0, status.connection_status); EXPECT_EQ(SSLStatus::NORMAL_CONTENT, status.content_status); // Verify that the Equals() method returns false if two SSLStatus objects
diff --git a/media/base/media_permission.h b/media/base/media_permission.h index e026ba2..5380202 100644 --- a/media/base/media_permission.h +++ b/media/base/media_permission.h
@@ -9,8 +9,6 @@ #include "base/macros.h" #include "media/base/media_export.h" -class GURL; - namespace media { // Interface to handle media related permission checks and requests. @@ -32,14 +30,12 @@ // |false| if the permission has never been set. virtual void HasPermission( Type type, - const GURL& security_origin, const PermissionStatusCB& permission_status_cb) = 0; // Requests |type| permission for |security_origion|. This may trigger user // interaction (e.g. permission prompt) if the permission has never been set. virtual void RequestPermission( Type type, - const GURL& security_origin, const PermissionStatusCB& permission_status_cb) = 0; // Whether to allow the use of Encrypted Media Extensions (EME), except for
diff --git a/media/base/mime_util.cc b/media/base/mime_util.cc index 1409e8ec..1bd72ff 100644 --- a/media/base/mime_util.cc +++ b/media/base/mime_util.cc
@@ -55,4 +55,8 @@ mime_type, codec_id, ambiguous_codec_string, out_codec); } +void RemoveProprietaryMediaTypesAndCodecsForTests() { + GetMimeUtil()->RemoveProprietaryMediaTypesAndCodecs(); +} + } // namespace media
diff --git a/media/base/mime_util.h b/media/base/mime_util.h index 33f01fe..0ff6703 100644 --- a/media/base/mime_util.h +++ b/media/base/mime_util.h
@@ -85,6 +85,12 @@ IsSupportedEncryptedMediaFormat(const std::string& mime_type, const std::vector<std::string>& codecs); +// Test only method that removes proprietary media types and codecs from the +// list of supported MIME types and codecs. These types and codecs must be +// removed to ensure consistent layout test results across all Chromium +// variations. +MEDIA_EXPORT void RemoveProprietaryMediaTypesAndCodecsForTests(); + } // namespace media #endif // MEDIA_BASE_MIME_UTIL_H_
diff --git a/media/base/mime_util_internal.cc b/media/base/mime_util_internal.cc index ed864dc..9c929b21 100644 --- a/media/base/mime_util_internal.cc +++ b/media/base/mime_util_internal.cc
@@ -518,6 +518,25 @@ return AreSupportedCodecs(parsed_results, mime_type_lower_case, is_encrypted); } +void MimeUtil::RemoveProprietaryMediaTypesAndCodecs() { + for (const auto& container : proprietary_media_containers_) + media_format_map_.erase(container); + + // TODO(chcunningham): Delete this hack (really this whole test-only method). + // This is done as short term workaround for LayoutTests to pass. MP4 is no + // longer proprietary, but may still contain proprietary codecs (e.g. AVC). + // Many layout tests only check for container support and may break (absent + // this hack) if run on a non-proprietary build. This mess is being fixed in + // https://chromium-review.googlesource.com/c/chromium/src/+/807604 + media_format_map_.erase("video/mp4"); + media_format_map_.erase("audio/mp4"); + media_format_map_.erase("audio/mpeg"); + media_format_map_.erase("audio/mp3"); + media_format_map_.erase("audio/x-mp3"); + + allow_proprietary_codecs_ = false; +} + // static bool MimeUtil::IsCodecSupportedOnAndroid( Codec codec,
diff --git a/media/base/mime_util_internal.h b/media/base/mime_util_internal.h index 7c528d4..d8677316 100644 --- a/media/base/mime_util_internal.h +++ b/media/base/mime_util_internal.h
@@ -86,6 +86,8 @@ const std::vector<std::string>& codecs, bool is_encrypted) const; + void RemoveProprietaryMediaTypesAndCodecs(); + // Checks android platform specific codec restrictions. Returns true if // |codec| is supported when contained in |mime_type_lower_case|. // |is_encrypted| means the codec will be used with encrypted blocks.
diff --git a/media/blink/key_system_config_selector.cc b/media/blink/key_system_config_selector.cc index 49beb05e..95a1fab 100644 --- a/media/blink/key_system_config_selector.cc +++ b/media/blink/key_system_config_selector.cc
@@ -942,7 +942,7 @@ GURL security_origin(url::Origin(request->security_origin).GetURL()); DVLOG(3) << "Request permission."; media_permission_->RequestPermission( - MediaPermission::PROTECTED_MEDIA_IDENTIFIER, security_origin, + MediaPermission::PROTECTED_MEDIA_IDENTIFIER, base::Bind(&KeySystemConfigSelector::OnPermissionResult, weak_factory_.GetWeakPtr(), base::Passed(&request))); }
diff --git a/media/blink/key_system_config_selector_unittest.cc b/media/blink/key_system_config_selector_unittest.cc index 3548ebc..6b1db5b 100644 --- a/media/blink/key_system_config_selector_unittest.cc +++ b/media/blink/key_system_config_selector_unittest.cc
@@ -197,14 +197,12 @@ public: // MediaPermission implementation. void HasPermission(Type type, - const GURL& security_origin, const PermissionStatusCB& permission_status_cb) override { permission_status_cb.Run(is_granted); } void RequestPermission( Type type, - const GURL& security_origin, const PermissionStatusCB& permission_status_cb) override { requests++; permission_status_cb.Run(is_granted);
diff --git a/net/tools/cachetool/cachetool.cc b/net/tools/cachetool/cachetool.cc index 2c3207f..c93f761 100644 --- a/net/tools/cachetool/cachetool.cc +++ b/net/tools/cachetool/cachetool.cc
@@ -194,7 +194,7 @@ // Implements CommandMarshal. void ReturnBuffer(net::GrowableIOBuffer* buffer) override { DCHECK(!has_failed()); - std::cout.write(buffer->data(), buffer->offset()); + std::cout.write(buffer->StartOfBuffer(), buffer->offset()); } // Implements CommandMarshal.
diff --git a/remoting/client/chromoting_session.cc b/remoting/client/chromoting_session.cc index 5a6db6e..0f1dbfd 100644 --- a/remoting/client/chromoting_session.cc +++ b/remoting/client/chromoting_session.cc
@@ -100,9 +100,7 @@ ChromotingSession::~ChromotingSession() { DCHECK(runtime_->network_task_runner()->BelongsToCurrentThread()); - if (client_) { - ReleaseResources(); - } + ReleaseResources(); } void ChromotingSession::Connect() { @@ -335,6 +333,11 @@ runtime_->ui_task_runner()->PostTask( FROM_HERE, base::Bind(&ChromotingSession::Delegate::OnConnectionState, delegate_, state, error)); + + if (state == protocol::ConnectionToHost::CLOSED || + state == protocol::ConnectionToHost::FAILED) { + ReleaseResources(); + } } void ChromotingSession::OnConnectionReady(bool ready) { @@ -509,7 +512,13 @@ client_context_.reset(); cursor_shape_stub_.reset(); - weak_factory_.InvalidateWeakPtrs(); + // Weak factory can only be invalidated once (due to DCHECK in it). After that + // the instance will no longer be usable. This is a design flaw that makes the + // instance no longer reusable after the caller calls Disconnect. Ideally we + // should factor out a Core that lives between (Connect, Disconnect). + if (weak_ptr_) { + weak_factory_.InvalidateWeakPtrs(); + } } } // namespace remoting
diff --git a/remoting/ios/app/client_connection_view_controller.mm b/remoting/ios/app/client_connection_view_controller.mm index e8effdf..8468a9b 100644 --- a/remoting/ios/app/client_connection_view_controller.mm +++ b/remoting/ios/app/client_connection_view_controller.mm
@@ -476,6 +476,7 @@ [self.navigationController pushViewController:hostViewController animated:NO]; } +// TODO(yuweih): Unused. Remove this method and the ClientViewReconnect enum. - (void)showReconnect { _statusLabel.text = [self stringWithHostNameForId:IDS_CONNECTION_CLOSED_FOR_HOST_MESSAGE]; @@ -496,6 +497,12 @@ } - (void)showError { + // Error may happen after the session is connected. In this case we should + // pop back to the client connection VC. + if (self.navigationController.topViewController != self) { + [self.navigationController popToViewController:self animated:YES]; + } + _statusLabel.text = [self stringWithHostNameForId:IDS_ERROR_CONNECTING_TO_HOST_MESSAGE];
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process b/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process index 748f826..3fb15626 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process +++ b/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process
@@ -1,6 +1,10 @@ # These tests currently fail when they run with --site-per-process. # See https://crbug.com/477150. +# https://crbug.com/794631: Recent regression. +crbug.com/794631 virtual/unified-autoplay/external/wpt/feature-policy/autoplay-allowed-by-feature-policy-attribute.https.sub.html [ Failure ] +crbug.com/794631 virtual/unified-autoplay/external/wpt/feature-policy/autoplay-allowed-by-feature-policy.https.sub.html [ Failure ] + # https://crbug.com/793127: Crash related to frame consolidation CL. crbug.com/793127 http/tests/security/upgrade-insecure-requests/iframe-upgrade.https.html [ Crash ]
diff --git a/third_party/WebKit/LayoutTests/compositing/geometry/clipped-video-controller.html b/third_party/WebKit/LayoutTests/compositing/geometry/clipped-video-controller.html index 5d11cbf..f0909ef 100644 --- a/third_party/WebKit/LayoutTests/compositing/geometry/clipped-video-controller.html +++ b/third_party/WebKit/LayoutTests/compositing/geometry/clipped-video-controller.html
@@ -3,7 +3,7 @@ <html> <head> <style> - + #box { position: absolute; top: 50px; @@ -13,14 +13,15 @@ overflow: hidden; border: 10px solid green; } - + </style> <script src="../resources/media-testing.js"></script> + <script src="../../media/media-file.js"></script> <script type="text/javascript" charset="utf-8"> if (window.testRunner) testRunner.dumpAsText(); - + function testDone() { if (window.testRunner) @@ -30,7 +31,7 @@ function doTest() { var video = document.getElementsByTagName('video')[0]; - setupVideo(video, '../resources/video.ogv', testDone); + setupVideo(video, '../resources/video', testDone); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/geometry/video-fixed-scrolling.html b/third_party/WebKit/LayoutTests/compositing/geometry/video-fixed-scrolling.html index 72ff181..521430ab 100644 --- a/third_party/WebKit/LayoutTests/compositing/geometry/video-fixed-scrolling.html +++ b/third_party/WebKit/LayoutTests/compositing/geometry/video-fixed-scrolling.html
@@ -8,13 +8,13 @@ body { height: 1000px; } - + video { margin-top: 80px; width: 400px; height: 300px; } - + #fixed-bar { position: fixed; left: 0; @@ -25,7 +25,8 @@ } </style> <script src="../resources/media-testing.js"></script> - <script type="text/javascript" charset="utf-8"> + <script src="../../media/media-file.js"></script> + <script type="text/javascript" charset="utf-8"> function testDone() { window.scrollBy(50, 50); @@ -36,7 +37,7 @@ function doTest() { var video = document.getElementsByTagName('video')[0]; - setupVideo(video, '../resources/video.ogv', testDone); + setupVideo(video, '../resources/video', testDone); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/geometry/video-opacity-overlay.html b/third_party/WebKit/LayoutTests/compositing/geometry/video-opacity-overlay.html index 5259b28..4a5d6fc 100644 --- a/third_party/WebKit/LayoutTests/compositing/geometry/video-opacity-overlay.html +++ b/third_party/WebKit/LayoutTests/compositing/geometry/video-opacity-overlay.html
@@ -6,21 +6,21 @@ width: 100%; height: 100%; } - + .container { position: relative; width: 400px; height: 300px; border: 1px solid black; } - + .controls { opacity: 0.8; height: 10px; width: 10px; background-color: green; } - + #control-bar { position: absolute; left: 0; @@ -31,7 +31,8 @@ } </style> <script src="../resources/media-testing.js"></script> - <script type="text/javascript" charset="utf-8"> + <script src="../../media/media-file.js"></script> + <script type="text/javascript" charset="utf-8"> function testDone() { if (window.testRunner) @@ -41,7 +42,7 @@ function doTest() { var video = document.getElementsByTagName('video')[0]; - setupVideo(video, '../resources/video.ogv', testDone); + setupVideo(video, '../resources/video', testDone); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/layers-inside-overflow-scroll.html b/third_party/WebKit/LayoutTests/compositing/layers-inside-overflow-scroll.html index 16191b6..0c8cbca 100644 --- a/third_party/WebKit/LayoutTests/compositing/layers-inside-overflow-scroll.html +++ b/third_party/WebKit/LayoutTests/compositing/layers-inside-overflow-scroll.html
@@ -10,7 +10,7 @@ margin: 10px; border: 1px solid black; } - + #details { width: 300px; height: 150px; @@ -25,7 +25,7 @@ font-size: 24pt; line-height: 150%; } - + .compositing { height: 100px; width: 100px; @@ -34,6 +34,7 @@ } </style> <script src="resources/media-testing.js"></script> + <script src="../media/media-file.js"></script> <script type="text/javascript" charset="utf-8"> function testDone() @@ -46,7 +47,7 @@ function doTest() { var video = document.getElementsByTagName('video')[0]; - setupVideo(video, 'resources/video.ogv', testDone); + setupVideo(video, 'resources/video', testDone); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/overflow/scroll-ancestor-update.html b/third_party/WebKit/LayoutTests/compositing/overflow/scroll-ancestor-update.html index 8f3f1dd..33128f0 100644 --- a/third_party/WebKit/LayoutTests/compositing/overflow/scroll-ancestor-update.html +++ b/third_party/WebKit/LayoutTests/compositing/overflow/scroll-ancestor-update.html
@@ -3,7 +3,7 @@ <html> <head> <style type="text/css" media="screen"> - + body { margin: 0; } @@ -12,7 +12,7 @@ width: 100px; height: 100px; } - + .container { position: absolute; top: 50px; @@ -20,18 +20,18 @@ height: 200px; width: 200px; } - + #scroller { overflow-y: scroll; height: 200px; width: 200px; border: 1px solid black; } - + .content { height: 500px; } - + .box { height: 100px; width: 100px; @@ -42,7 +42,7 @@ margin-top: 50px; background-color: green; } - + .indicator { position: absolute; left: 50px; @@ -52,7 +52,8 @@ </style> <script src="../resources/media-testing.js"></script> - <script type="text/javascript" charset="utf-8"> + <script src="../../media/media-file.js"></script> + <script type="text/javascript" charset="utf-8"> function testDone() { document.getElementById('scroller').scrollTop = 50; @@ -63,12 +64,12 @@ function doTest() { var video = document.getElementsByTagName('video')[0]; - setupVideo(video, '../resources/video.ogv', testDone); + setupVideo(video, '../resources/video', testDone); } </script> </head> <body onload="doTest()"> - + <div class="indicator box"></div> <div class="container"> @@ -79,7 +80,7 @@ </div> <p>The green box should obscure the red box, and move when you drag the scrollbar.</p> </div> - + <video></video> </body>
diff --git a/third_party/WebKit/LayoutTests/compositing/reflections/load-video-in-reflection.html b/third_party/WebKit/LayoutTests/compositing/reflections/load-video-in-reflection.html index b116503..14e7293 100644 --- a/third_party/WebKit/LayoutTests/compositing/reflections/load-video-in-reflection.html +++ b/third_party/WebKit/LayoutTests/compositing/reflections/load-video-in-reflection.html
@@ -8,7 +8,7 @@ width: 300px; -webkit-animation: spin 18s infinite linear; } - + video { -webkit-box-reflect: below; background-color: red; @@ -21,7 +21,8 @@ </style> <script src="../resources/media-testing.js"></script> - <script type="text/javascript" charset="utf-8"> + <script src="../../media/media-file.js"></script> + <script type="text/javascript" charset="utf-8"> function testDone() { if (window.testRunner) @@ -31,7 +32,7 @@ function doTest() { var video = document.getElementsByTagName('video')[0]; - setupVideo(video, '../resources/video.ogv', testDone); + setupVideo(video, '../resources/video', testDone); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/resources/media-testing.js b/third_party/WebKit/LayoutTests/compositing/resources/media-testing.js index 9700ddc1..ace3320 100644 --- a/third_party/WebKit/LayoutTests/compositing/resources/media-testing.js +++ b/third_party/WebKit/LayoutTests/compositing/resources/media-testing.js
@@ -4,6 +4,7 @@ function setupVideo(videoElement, videoPath, canPlayThroughCallback) { + var mediaFile = findMediaFile("video", videoPath); videoElement.addEventListener("canplaythrough", canPlayThroughCallback); - videoElement.src = videoPath; + videoElement.src = mediaFile; }
diff --git a/third_party/WebKit/LayoutTests/compositing/self-painting-layers.html b/third_party/WebKit/LayoutTests/compositing/self-painting-layers.html index 8d92a70c..f4b4fd57 100644 --- a/third_party/WebKit/LayoutTests/compositing/self-painting-layers.html +++ b/third_party/WebKit/LayoutTests/compositing/self-painting-layers.html
@@ -10,7 +10,7 @@ margin: 10px; border: 1px solid black; } - + #details { width: 300px; height: 150px; @@ -28,6 +28,7 @@ </style> <script src="resources/media-testing.js"></script> + <script src="../media/media-file.js"></script> <script type="text/javascript" charset="utf-8"> function testDone() @@ -40,7 +41,7 @@ function doTest() { var video = document.getElementsByTagName('video')[0]; - setupVideo(video, 'resources/video.ogv', testDone); + setupVideo(video, 'resources/video', testDone); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html b/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html index 317db2b..3312ea4 100644 --- a/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html +++ b/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <title>Test "-webkit-box-reflect" property on a video element.</title> <script src="../../resources/run-after-layout-and-paint.js"></script> +<script src="../../media/media-file.js"></script> <style> video { -webkit-box-reflect: below 0px; @@ -18,6 +19,6 @@ runAfterLayoutAndPaint(function() {}, true); }; -video.src = '../../media/content/test.ogv'; +video.src = findMediaFile('video', '../../media/content/test'); video.currentTime = 1; </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/compositing/visibility/visibility-simple-video-layer.html b/third_party/WebKit/LayoutTests/compositing/visibility/visibility-simple-video-layer.html index f7e7dbd..42d13f1 100644 --- a/third_party/WebKit/LayoutTests/compositing/visibility/visibility-simple-video-layer.html +++ b/third_party/WebKit/LayoutTests/compositing/visibility/visibility-simple-video-layer.html
@@ -29,7 +29,8 @@ </style> <script src="../resources/media-testing.js"></script> - <script type="text/javascript" charset="utf-8"> + <script src="../../media/media-file.js"></script> + <script type="text/javascript" charset="utf-8"> if (window.testRunner) testRunner.dumpAsTextWithPixelResults(); @@ -42,9 +43,9 @@ function doTest() { - setupVideo(document.getElementsByTagName('video')[0], '../resources/video.ogv', notifyVideoDone); - setupVideo(document.getElementsByTagName('video')[1], '../resources/video.ogv', notifyVideoDone); - setupVideo(document.getElementsByTagName('video')[2], '../resources/video.ogv', notifyVideoDone); + setupVideo(document.getElementsByTagName('video')[0], '../resources/video', notifyVideoDone); + setupVideo(document.getElementsByTagName('video')[1], '../resources/video', notifyVideoDone); + setupVideo(document.getElementsByTagName('video')[2], '../resources/video', notifyVideoDone); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt index 5437203..5096c82b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt
@@ -1,10 +1,10 @@ This is a testharness.js-based test. -Found 59 tests; 54 PASS, 5 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 59 tests; 46 PASS, 13 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS utility code PASS application/octet-stream PASS video/x-new-fictional-format -PASS audio/mp4 (optional) -PASS audio/mp4; codecs="mp4a.40.2" (optional) +FAIL audio/mp4 (optional) assert_equals: audio/mp4 expected "maybe" but got "" +FAIL audio/mp4; codecs="mp4a.40.2" (optional) assert_equals: audio/mp4; codecs="mp4a.40.2" expected "probably" but got "" PASS audio/mp4 with bogus codec PASS audio/mp4 with and without codecs PASS audio/ogg (optional) @@ -28,12 +28,12 @@ PASS video/3gpp codecs order PASS video/3gpp with bogus codec PASS video/3gpp with and without codecs -PASS video/mp4 (optional) -PASS video/mp4; codecs="mp4a.40.2" (optional) -PASS video/mp4; codecs="avc1.42E01E" (optional) -PASS video/mp4; codecs="avc1.4D401E" (optional) -PASS video/mp4; codecs="avc1.58A01E" (optional) -PASS video/mp4; codecs="avc1.64001E" (optional) +FAIL video/mp4 (optional) assert_equals: video/mp4 expected "maybe" but got "" +FAIL video/mp4; codecs="mp4a.40.2" (optional) assert_equals: video/mp4; codecs="mp4a.40.2" expected "probably" but got "" +FAIL video/mp4; codecs="avc1.42E01E" (optional) assert_equals: video/mp4; codecs="avc1.42E01E" expected "probably" but got "" +FAIL video/mp4; codecs="avc1.4D401E" (optional) assert_equals: video/mp4; codecs="avc1.4D401E" expected "probably" but got "" +FAIL video/mp4; codecs="avc1.58A01E" (optional) assert_equals: video/mp4; codecs="avc1.58A01E" expected "probably" but got "" +FAIL video/mp4; codecs="avc1.64001E" (optional) assert_equals: video/mp4; codecs="avc1.64001E" expected "probably" but got "" FAIL video/mp4; codecs="mp4v.20.8" (optional) assert_equals: video/mp4; codecs="mp4v.20.8" expected "probably" but got "" FAIL video/mp4; codecs="mp4v.20.240" (optional) assert_equals: video/mp4; codecs="mp4v.20.240" expected "probably" but got "" PASS video/mp4 codecs subset
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-expected.txt index 8df4efd..ecaf93e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-expected.txt
@@ -7,8 +7,8 @@ PASS Test addSourceBuffer() with Vorbis and VP8 in separate SourceBuffers PASS Test addSourceBuffer() video only PASS Test addSourceBuffer() audio only -PASS Test addSourceBuffer() with AAC and H.264 -PASS Test addSourceBuffer() with AAC and H.264 in separate SourceBuffers +FAIL Test addSourceBuffer() with AAC and H.264 assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported expected true got false +FAIL Test addSourceBuffer() with AAC and H.264 in separate SourceBuffers assert_true: video/mp4;codecs="avc1.4D4001" is supported expected true got false FAIL Test addSourceBuffer() QuotaExceededError. assert_true: Reached SourceBuffer limit. expected true got false Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-mode-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-mode-expected.txt index 3b81c8d..8768da7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-mode-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-mode-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. PASS addSourceBuffer() sets SourceBuffer.mode to 'segments' when the generate timestamps flag is false -FAIL addSourceBuffer() sets SourceBuffer.mode to 'sequence' when the generate timestamps flag is true assert_equals: expected "sequence" but got "segments" +FAIL addSourceBuffer() sets SourceBuffer.mode to 'sequence' when the generate timestamps flag is true assert_unreached: Browser does not support the audio/aac and audio/mpeg MIME types used in this test Reached unreachable code Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-buffered-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-buffered-expected.txt index 08389f9..28ae3356 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-buffered-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-buffered-expected.txt
@@ -1,7 +1,7 @@ This is a testharness.js-based test. -FAIL Demuxed content with different lengths assert_equals: mediaSource.activeSourceBuffers[1] expected "{ [0.067, 2.067) }" but got "{ [0.000, 2.000) }" -FAIL Muxed content with different lengths assert_equals: mediaSource.activeSourceBuffers[0] expected "{ [0.067, 2.043) }" but got "{ [0.000, 2.000) }" -PASS Demuxed content with an empty buffered range on one SourceBuffer +FAIL Demuxed content with different lengths assert_equals: mediaSource.activeSourceBuffers[0] expected "{ [0.000, 2.023) }" but got "{ [0.000, 2.022) }" +FAIL Muxed content with different lengths assert_equals: mediaSource.activeSourceBuffers[0] expected "{ [0.003, 2.004) }" but got "{ [0.000, 2.003) }" +FAIL Demuxed content with an empty buffered range on one SourceBuffer assert_equals: mediaSource.activeSourceBuffers[0] expected "{ [0.000, 2.023) }" but got "{ [0.000, 2.022) }" PASS Muxed content empty buffered ranges. PASS Get buffered range when sourcebuffer is empty. PASS Get buffered range when only init segment is appended.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt new file mode 100644 index 0000000..fa56a24 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Tests mp4 audio-only bitrate changes. assert_true: audio/mp4;codecs="mp4a.40.2" is supported. expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt new file mode 100644 index 0000000..2b7793b3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Tests mp4 audio bitrate changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-framesize-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-framesize-expected.txt new file mode 100644 index 0000000..3e82c6e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-framesize-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Tests mp4 frame size changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt new file mode 100644 index 0000000..8efe81a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Tests mp4 video bitrate changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt new file mode 100644 index 0000000..8f53878c6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Tests mp4 video-only bitrate changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framerate-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framerate-expected.txt new file mode 100644 index 0000000..61e3e73 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framerate-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Tests mp4 video-only frame rate changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framesize-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framesize-expected.txt new file mode 100644 index 0000000..9f613a78 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framesize-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Tests mp4 video-only frame size changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream-expected.txt index 3e32022..f5c8646f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. FAIL MediaSource.endOfStream(): duration truncated to 0 when there are no buffered coded frames assert_equals: expected 0 but got 2 PASS MediaSource.endOfStream(): media element notified that it now has all of the media data -FAIL MediaSource.endOfStream(): duration and buffered range end time before and after endOfStream assert_equals: SegmentInfo duration should still roughly match mediaSource duration expected 6.548 but got 6.549 +PASS MediaSource.endOfStream(): duration and buffered range end time before and after endOfStream Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream.html b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream.html index 5b6114f..bca80af8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream.html +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream.html
@@ -52,8 +52,7 @@ // Note that segmentInfo.duration is expected to also be the // highest track buffer range end time. Therefore, endOfStream() should // not change duration with this media. - assert_equals(threeDecimalPlaces(segmentInfo.duration), threeDecimalPlaces(mediaSource.duration), - 'SegmentInfo duration should initially roughly match mediaSource duration'); + assert_equals(threeDecimalPlaces(segmentInfo.duration), threeDecimalPlaces(mediaSource.duration)); assert_less_than_equal(highestEndTime, mediaSource.duration, 'Media duration may be slightly longer than intersected track buffered ranges'); @@ -65,8 +64,7 @@ assert_equals(sourceBuffer.buffered.length, 1, 'Media data properly buffered after endOfStream'); - assert_equals(threeDecimalPlaces(segmentInfo.duration), threeDecimalPlaces(mediaSource.duration), - 'SegmentInfo duration should still roughly match mediaSource duration'); + assert_equals(threeDecimalPlaces(segmentInfo.duration), threeDecimalPlaces(mediaSource.duration)); assert_less_than_equal(highestEndTime, mediaSource.duration, 'Media duration may be slightly longer than intersected track buffered ranges'); assert_equals(sourceBuffer.buffered.end(0), mediaSource.duration,
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-is-type-supported-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-is-type-supported-expected.txt new file mode 100644 index 0000000..98a290e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-is-type-supported-expected.txt
@@ -0,0 +1,43 @@ +This is a testharness.js-based test. +PASS Test invalid MIME format "video" +PASS Test invalid MIME format "video/" +PASS Test invalid MIME format "video/webm" +PASS Test invalid MIME format "video/webm;" +PASS Test invalid MIME format "video/webm;codecs" +PASS Test invalid MIME format "video/webm;codecs=" +PASS Test invalid MIME format "video/webm;codecs="" +PASS Test invalid MIME format "video/webm;codecs=""" +PASS Test invalid MIME format "video/webm;codecs=","" +PASS Test invalid MIME format "" +PASS Test invalid MIME format "null" +PASS Test invalid MSE MIME media type "xxx" +PASS Test invalid MSE MIME media type "text/html" +PASS Test invalid MSE MIME media type "image/jpeg" +PASS Test invalid mismatch between major type and codec ID "audio/webm;codecs="vp8"" +PASS Test invalid mismatch between major type and codec ID "audio/mp4;codecs="avc1.4d001e"" +PASS Test invalid mismatch between minor type and codec ID "audio/mp4;codecs="vorbis"" +PASS Test invalid mismatch between minor type and codec ID "audio/webm;codecs="mp4a.40.2"" +PASS Test invalid mismatch between minor type and codec ID "video/mp4;codecs="vp8"" +PASS Test invalid mismatch between minor type and codec ID "video/webm;codecs="mp4a.40.2"" +PASS Test invalid mismatch between minor type and codec ID "video/mp4;codecs="vorbis"" +PASS Test invalid codec ID "audio/mp4;codecs="mp4a"" +PASS Test invalid codec ID "audio/mp4;codecs="mp4a.40"" +PASS Test invalid codec ID "audio/mp4;codecs="mp4a.40."" +PASS Test invalid codec ID "audio/mp4;codecs="mp4a.67.3"" +PASS Test valid WebM type "video/webm;codecs="vp8"" +PASS Test valid WebM type "video/webm;codecs="vorbis"" +PASS Test valid WebM type "video/webm;codecs="vp8,vorbis"" +PASS Test valid WebM type "video/webm;codecs="vorbis, vp8"" +PASS Test valid WebM type "audio/webm;codecs="vorbis"" +PASS Test valid WebM type "AUDIO/WEBM;CODECS="vorbis"" +FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "video/mp4;codecs="avc1.42001e"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.40.2"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.40.5"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.67"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "video/mp4;codecs="mp4a.40.2"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.2"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "video/mp4;codecs="mp4a.40.2 , avc1.4d001e "" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.5"" assert_equals: supported expected true but got false +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sequencemode-append-buffer-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sequencemode-append-buffer-expected.txt index 349102a..2a09f25 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sequencemode-append-buffer-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sequencemode-append-buffer-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. -FAIL Test sequence AppendMode appendBuffer(first media segment) assert_equals: sourceBuffer.buffered range begins where expected before EOS expected 0.095 but got 0 -FAIL Test sequence AppendMode appendBuffer(second media segment) assert_equals: Event types match. expected "update" but got "updateend" -FAIL Test sequence AppendMode appendBuffer(second media segment, then first media segment) assert_equals: Event types match. expected "update" but got "updateend" +FAIL Test sequence AppendMode appendBuffer(first media segment) assert_equals: sourceBuffer.buffered range begins where expected before EOS expected 0.112 but got 0 +FAIL Test sequence AppendMode appendBuffer(second media segment) assert_equals: sourceBuffer.buffered range begins where expected before EOS expected 0.001 but got 0 +FAIL Test sequence AppendMode appendBuffer(second media segment, then first media segment) assert_equals: expectedTimestampOffset expected 0.802 but got 0.801 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sourcebuffer-mode-timestamps-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sourcebuffer-mode-timestamps-expected.txt index 738b6287..420841f2 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sourcebuffer-mode-timestamps-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sourcebuffer-mode-timestamps-expected.txt
@@ -1,9 +1,5 @@ This is a testharness.js-based test. -FAIL audio/aac : If generate timestamps flag equals true and new mode equals "segments", then throw a TypeError exception and abort these steps. assert_throws: SourceBuffer#mode with generate timestamps flag true function "function () { - sourceBuffer.mode = "segments"; - }" did not throw -FAIL audio/mpeg : If generate timestamps flag equals true and new mode equals "segments", then throw a TypeError exception and abort these steps. assert_throws: SourceBuffer#mode with generate timestamps flag true function "function () { - sourceBuffer.mode = "segments"; - }" did not throw +FAIL audio/aac : If generate timestamps flag equals true and new mode equals "segments", then throw a TypeError exception and abort these steps. assert_unreached: Browser doesn't support the MIME used in this test: audio/aac Reached unreachable code +FAIL audio/mpeg : If generate timestamps flag equals true and new mode equals "segments", then throw a TypeError exception and abort these steps. assert_unreached: Browser doesn't support the MIME used in this test: audio/mpeg Reached unreachable code Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video-shadow.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video-shadow.html index b54321c..04b3a17 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video-shadow.html +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video-shadow.html
@@ -22,8 +22,8 @@ <div><table id='outputtable'></table></div> <div>Test Video</div> <div><video id="video"> - <source src="resources/canvas_video.webm" type='video/webm' /> <source src="resources/canvas_video.mp4" type='video/mp4' /> + <source src="resources/canvas_video.webm" type='video/webm' /> <source src="resources/canvas_video.ogv" type='video/ogg' /> </video></div> <script type="application/x-javascript">
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video.html index 73b6e4af..6f63ed1 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video.html +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video.html
@@ -22,8 +22,8 @@ <div><table id='outputtable'></table></div> <div>Test Video</div> <div><video id="video"> - <source src="resources/canvas_video.webm" type='video/webm' /> <source src="resources/canvas_video.mp4" type='video/mp4' /> + <source src="resources/canvas_video.webm" type='video/webm' /> <source src="resources/canvas_video.ogv" type='video/ogg' /> </video></div> <script type="application/x-javascript">
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-video.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-video.html index 480496e0..b90614ab 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-video.html +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-video.html
@@ -10,8 +10,8 @@ <body> <canvas id="canvas"></canvas> <video id="video"> - <source src="resources/canvas_video.webm" type='video/webm' /> <source src="resources/canvas_video.mp4" type='video/mp4' /> + <source src="resources/canvas_video.webm" type='video/webm' /> <source src="resources/canvas_video.ogv" type='video/ogg' /> </video> <script>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-pattern-video.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-pattern-video.html index f26f242..293dd460 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-pattern-video.html +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-pattern-video.html
@@ -10,8 +10,8 @@ <body> <canvas id="canvas"></canvas> <video id="video"> - <source src="resources/canvas_video.webm" type='video/webm' /> <source src="resources/canvas_video.mp4" type='video/mp4' /> + <source src="resources/canvas_video.webm" type='video/webm' /> <source src="resources/canvas_video.ogv" type='video/ogg' /> </video> <script>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/yuv-video-on-accelerated-canvas.html b/third_party/WebKit/LayoutTests/fast/canvas/yuv-video-on-accelerated-canvas.html index 493ad00..03b9993 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/yuv-video-on-accelerated-canvas.html +++ b/third_party/WebKit/LayoutTests/fast/canvas/yuv-video-on-accelerated-canvas.html
@@ -26,8 +26,8 @@ <canvas id="hw-canvas" width=300 height=300></canvas> <canvas id="sw-canvas" width=150 height=150></canvas> <video id="video" loop> - <source src="resources/canvas_video.webm" type='video/webm' /> <source src="resources/canvas_video.mp4" type='video/mp4' /> + <source src="resources/canvas_video.webm" type='video/webm' /> <source src="resources/canvas_video.ogv" type='video/ogg' /> </video> <script>
diff --git a/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html b/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html index 40b82d0..76d1c38 100644 --- a/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html +++ b/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html
@@ -2,11 +2,12 @@ <title>This tests that media element in a standalone media document cannot be focused directly using focus() method or by mouse click.</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../../media/media-file.js"></script> <iframe width="380" height="330"></iframe> <script> async_test(function(t) { var iframe = document.querySelector("iframe"); - iframe.src = "../../media/" + "content/test.ogv"; + iframe.src = "../../media/" + findMediaFile("video", "content/test"); iframe.onload = t.step_func(function() { var standaloneMediaDocument = iframe.contentDocument;
diff --git a/third_party/WebKit/LayoutTests/fast/overflow/overflow-of-video-outline.html b/third_party/WebKit/LayoutTests/fast/overflow/overflow-of-video-outline.html index c30c719a..8d66d5c 100644 --- a/third_party/WebKit/LayoutTests/fast/overflow/overflow-of-video-outline.html +++ b/third_party/WebKit/LayoutTests/fast/overflow/overflow-of-video-outline.html
@@ -2,6 +2,7 @@ <head> </head> <script src="../../media/media-controls.js"></script> +<script src="../../media/media-file.js"></script> <video id=video controls width=400> </video>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/resources/video.html b/third_party/WebKit/LayoutTests/fullscreen/resources/video.html index 4d9febe..aba93ee2 100644 --- a/third_party/WebKit/LayoutTests/fullscreen/resources/video.html +++ b/third_party/WebKit/LayoutTests/fullscreen/resources/video.html
@@ -1,4 +1,5 @@ <!DOCTYPE html> +<script src="../../media/media-file.js"></script> <script> function canplaythrough() { parent.postMessage("Video loaded", "*"); @@ -10,7 +11,7 @@ onload = function() { var video = document.getElementById('video'); - var mediaFile = "../../media/content/test.ogv"; + var mediaFile = findMediaFile("video", "../../media/content/test"); video.src = mediaFile; video.addEventListener('canplaythrough', canplaythrough); video.addEventListener('webkitfullscreenchange', fullscreenChanged);
diff --git a/third_party/WebKit/LayoutTests/fullscreen/video-controls-timeline.html b/third_party/WebKit/LayoutTests/fullscreen/video-controls-timeline.html index 16da8863..ee23de3 100644 --- a/third_party/WebKit/LayoutTests/fullscreen/video-controls-timeline.html +++ b/third_party/WebKit/LayoutTests/fullscreen/video-controls-timeline.html
@@ -7,7 +7,8 @@ </script> <script src="full-screen-test.js"></script> <script src="../media/media-controls.js"></script> - <script> + <script src="../media/media-file.js"></script> + <script> var video = document.getElementById('video'); var timeline; @@ -32,6 +33,6 @@ runWithKeyDown(function(){video.webkitRequestFullScreen()}); }); - video.src = '../media/content/test.ogv'; + video.src = findMediaFile('video', '../media/content/test'); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/video-specified-size.html b/third_party/WebKit/LayoutTests/fullscreen/video-specified-size.html index 3a60f7f5..3b283a32 100644 --- a/third_party/WebKit/LayoutTests/fullscreen/video-specified-size.html +++ b/third_party/WebKit/LayoutTests/fullscreen/video-specified-size.html
@@ -7,7 +7,7 @@ <script src="full-screen-test.js"></script> <script src=../media/media-file.js></script> <script> - setSrcById("video", "../media/content/test.ogv"); + setSrcById("video", findMediaFile("video", "../media/content/test")); var video = document.getElementById('video'); waitForEventTestAndEnd(document, 'webkitfullscreenchange', "video.clientWidth==document.body.clientWidth"); runWithKeyDown(function(){video.webkitRequestFullScreen()});
diff --git a/third_party/WebKit/LayoutTests/hdr/color-profile-video.html b/third_party/WebKit/LayoutTests/hdr/color-profile-video.html index 0365c6a..6058fc33 100644 --- a/third_party/WebKit/LayoutTests/hdr/color-profile-video.html +++ b/third_party/WebKit/LayoutTests/hdr/color-profile-video.html
@@ -35,7 +35,7 @@ }; } - setSrcByTagName('video', '../media/content/test.ogv'); + setSrcByTagName('video', findMediaFile('video', '../media/content/test')); }; </script> </html>
diff --git a/third_party/WebKit/LayoutTests/hdr/video-canvas-alpha.html b/third_party/WebKit/LayoutTests/hdr/video-canvas-alpha.html index a24bc9f..b6376bf 100644 --- a/third_party/WebKit/LayoutTests/hdr/video-canvas-alpha.html +++ b/third_party/WebKit/LayoutTests/hdr/video-canvas-alpha.html
@@ -1,5 +1,6 @@ <html> <head> + <script src="../media/media-file.js"></script> <script> if (window.testRunner) { @@ -8,7 +9,7 @@ function onLoad() { video = document.getElementsByTagName('video')[0]; - video.src = "../media/content/test.ogv"; + video.src = findMediaFile("video", "../media/content/test"); canvas = document.getElementsByTagName('canvas')[0]; ctx = canvas.getContext('2d');
diff --git a/third_party/WebKit/LayoutTests/http/tests/appcache/video.html b/third_party/WebKit/LayoutTests/http/tests/appcache/video.html index 0ed8c09..106b624 100644 --- a/third_party/WebKit/LayoutTests/http/tests/appcache/video.html +++ b/third_party/WebKit/LayoutTests/http/tests/appcache/video.html
@@ -3,6 +3,7 @@ <title>Test that "video" can be loaded from the application cache.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="/media-resources/media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -18,14 +19,14 @@ // Setting "src" to file specified in manifest. This file should load. video.ondurationchange = t.step_func(test2); video.onerror = t.unreached_func(); - video.src = "/media-resources/content/test.ogv"; + video.src = "/media-resources/content/" + findMediaFile("video", "test"); } function test2() { // Setting "src" to valid media file not in manifest. This file should fail to load. video.ondurationchange = t.unreached_func(); video.onerror = t.step_func(test3); - video.src = "/media-resources/content/silence.oga"; + video.src = "/media-resources/content/" + findMediaFile("audio", "silence"); } function test3() {
diff --git a/third_party/WebKit/LayoutTests/http/tests/fullscreen/resources/media-file.js b/third_party/WebKit/LayoutTests/http/tests/fullscreen/resources/media-file.js new file mode 100644 index 0000000..c80abcb --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/fullscreen/resources/media-file.js
@@ -0,0 +1,72 @@ +var audioCodecs = [ + ["audio/wav", "wav"], + ["audio/aac", "m4a"], + ["audio/ogg", "oga"] +]; + +var videoCodecs = [ + ["video/mp4", "mp4"], + ["video/ogg", "ogv"], + ["video/webm","webm"] +]; + +function findMediaFile(tagName, name) { + var codecs; + if (tagName == "audio") + codecs = audioCodecs; + else + codecs = videoCodecs; + + var element = document.getElementsByTagName(tagName)[0]; + if (!element) + element = document.createElement(tagName); + + for (var i = 0; i < codecs.length; ++i) { + if (element.canPlayType(codecs[i][0])) + return name + "." + codecs[i][1]; + } + + return ""; +} + +function mimeTypeForExtension(extension) { + for (var i = 0; i < videoCodecs.length; ++i) { + if (extension == videoCodecs[i][1]) + return videoCodecs[i][0]; + } + for (var i = 0; i < audioCodecs.length; ++i) { + if (extension == audioCodecs[i][1]) + return audioCodecs[i][0]; + } + + return ""; +} + +function mimeTypeForFile(filename) { + var lastPeriodIndex = filename.lastIndexOf("."); + if (lastPeriodIndex > 0) + return mimeTypeForExtension(filename.substring(lastPeriodIndex + 1)); + + return ""; +} + +function setSrcByTagName(tagName, src) { + var elements = document.getElementsByTagName(tagName); + if (elements) { + for (var i = 0; i < elements.length; ++i) + elements[i].src = src; + } +} + +function setSrcById(id, src) { + var element = document.getElementById(id); + if (element) + element.src = src; +} + +function stripExtension(filename) { + var lastPeriodIndex = filename.lastIndexOf("."); + if (lastPeriodIndex > 0) + return filename.substring(0, lastPeriodIndex); + return filename; +}
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/audits/get-encoded-response-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/audits/get-encoded-response-expected.txt index 496d629b..db07523 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/audits/get-encoded-response-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/audits/get-encoded-response-expected.txt
@@ -24,3 +24,6 @@ body=string body.length~100 original=1322 encoded~100 +Results for /resources/load-and-stall.php?name=dummy.html&mimeType=image%2Fpng encoding=png q=undefined sizeOnly=undefined +failed to determine +
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/audits/get-encoded-response.js b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/audits/get-encoded-response.js index 3554f08..e90d7cc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/audits/get-encoded-response.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/audits/get-encoded-response.js
@@ -16,6 +16,11 @@ const requestId = (await dp.Network.onceResponseReceived()).params.requestId; const result = (await dp.Audits.getEncodedResponse({requestId, encoding, quality, sizeOnly})).result; + if (!result) { + testRunner.log('failed to determine'); + return; + } + const length = result.body && result.body.length; const encodedSize = result.encodedSize; testRunner.log(`body=${typeof result.body} body.length~${approximate(length, 100)}`); @@ -31,5 +36,7 @@ await logResponse("/resources/square20.bmp", "jpeg", .8, true); await logResponse("/resources/square20.bmp", "png"); + await logResponse("/resources/load-and-stall.php?name=dummy.html&mimeType=image%2Fpng", "png"); + testRunner.completeTest(); })
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html b/third_party/WebKit/LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html index 1fa45741..dc23b5d2 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html
@@ -24,7 +24,7 @@ t.done(); }); - var mediaFile = '../../../../media/content/silence.oga'; + var mediaFile = findMediaFile('audio', '../../../../media/content/silence'); var type = mimeTypeForExtension(mediaFile.split('.').pop()); audio.src = 'http://127.0.0.1:8000/media/resources/load-video.php' +
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/audio-timeline-seek-outside-seekable.html b/third_party/WebKit/LayoutTests/http/tests/media/audio-timeline-seek-outside-seekable.html index b082ff21..ee635ff 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/audio-timeline-seek-outside-seekable.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/audio-timeline-seek-outside-seekable.html
@@ -27,7 +27,7 @@ t.done(); }); - var mediaFile = '../../../../media/content/silence.oga'; + var mediaFile = findMediaFile('audio', '../../../../media/content/silence'); var type = mimeTypeForExtension(mediaFile.split('.').pop()); audio.src = 'http://127.0.0.1:8000/media/resources/load-video.php' +
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-delegation.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-delegation.html index d7748920..8e79957 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-delegation.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-delegation.html
@@ -3,6 +3,7 @@ <title>Test that gestures are delegated to child frames when the attribute is used.</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/media-resources/media-file.js"></script> <script src="resources/autoplay-test.js"></script> <!-- This is a cross origin iframe with a same origin child with allow="autoplay" --> <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-iframe-1a.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-disabled.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-disabled.html index f7a4a3a..2b70989 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-disabled.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-disabled.html
@@ -3,6 +3,7 @@ <title>Test that autoplay is disabled for cross origin by default.</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/media-resources/media-file.js"></script> <script src="resources/autoplay-test.js"></script> <!-- This is a cross origin iframe with a same origin child with allow="autoplay" --> <iframe src="http://localhost:8000/media/autoplay/resources/nested-iframe-1a.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-gesture.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-gesture.html index 883400a..5ce9123 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-gesture.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-gesture.html
@@ -3,6 +3,7 @@ <title>Test that autoplay works on a cross origin iframe if there is a gesture in that frame.</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/media-resources/media-file.js"></script> <script src="resources/autoplay-test.js"></script> <!-- This is a cross origin iframe with a same origin child with allow="autoplay" --> <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-iframe-1a.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-header.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-header.html index a56351e..1007a20 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-header.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-header.html
@@ -3,6 +3,7 @@ <title>Test that the header will override allow=autoplay.</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/media-resources/media-file.js"></script> <script src="resources/autoplay-test.js"></script> <!-- This is a cross origin iframe that disables autoplay with a HTTP header --> <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-frame-with-header.php"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-alternating.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-alternating.html index fd28b401..fcc5690 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-alternating.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-alternating.html
@@ -3,6 +3,7 @@ <title>Test that autoplay works on child frames, but only if allowed.</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/media-resources/media-file.js"></script> <script src="resources/autoplay-test.js"></script> <!-- This is a cross origin iframe with a same origin child with no allow attribute --> <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-iframe-1b.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-iframe-no-gesture.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-iframe-no-gesture.html index e68db76..003dcbb 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-iframe-no-gesture.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-iframe-no-gesture.html
@@ -3,6 +3,7 @@ <title>Test that autoplay is still disabled if there is no gesture, but autoplay is switched on.</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/media-resources/media-file.js"></script> <script src="resources/autoplay-test.js"></script> <!-- This is a cross origin iframe with a same origin child with allow="autoplay" --> <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-iframe-1a.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-same-origin.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-same-origin.html index 58b1267f..42d793dc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-same-origin.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-same-origin.html
@@ -3,6 +3,7 @@ <title>Test that gestures are delegated automatically to same origin child frames.</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/media-resources/media-file.js"></script> <script src="resources/autoplay-test.js"></script> <!-- This is a same origin frame with a sub origin child frame with no allow attributes --> <iframe src="/media/autoplay/resources/nested-iframe-1b.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/autoplay-test.js b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/autoplay-test.js index 19dd0294..a545ce7 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/autoplay-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/autoplay-test.js
@@ -40,7 +40,7 @@ function runVideoTest() { const video = document.createElement('video'); - video.src = '/media-resources/content/test.ogv'; + video.src = findMediaFile('video', '/media-resources/content/test'); video.play().then(tearDown, tearDown); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-frame-with-header.php b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-frame-with-header.php index fbfa916..5b6a1aa 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-frame-with-header.php +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-frame-with-header.php
@@ -3,5 +3,6 @@ ?> <!DOCTYPE html> <html> +<script src="../../../media-resources/media-file.js"></script> <script src="autoplay-test.js"></script> </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1a.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1a.html index a9a7c842..253dda8 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1a.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1a.html
@@ -1,4 +1,5 @@ <!DOCTYPE html> <html> +<script src="../../../media-resources/media-file.js"></script> <script src="autoplay-test.js"></script> <iframe allow="autoplay" src="http://127.0.0.1:8000/media/autoplay/resources/nested-iframe-2.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1b.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1b.html index fe16c033..db35333 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1b.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1b.html
@@ -1,4 +1,5 @@ <!DOCTYPE html> <html> +<script src="../../../media-resources/media-file.js"></script> <script src="autoplay-test.js"></script> <iframe src="http://127.0.0.1:8000/media/autoplay/resources/nested-iframe-2.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-2.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-2.html index 0145a8d..5b8a658 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-2.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-2.html
@@ -1,4 +1,5 @@ <!DOCTYPE html> <html> +<script src="../../../media-resources/media-file.js"></script> <script src="autoplay-test.js"></script> </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay-post-navigation.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay-post-navigation.html index 67acf70a..cfbbeb6 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay-post-navigation.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay-post-navigation.html
@@ -3,6 +3,7 @@ <title>Test user gesture is delegated to iframes after navigation.</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/media-resources/media-file.js"></script> <script src="autoplay-test.js"></script> <!-- This is a cross origin iframe with a same origin child with allow="autoplay" --> <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-iframe-1a.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay.html index e0c7dea..e912cf8b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <title>Test document user gesture autoplay policy across navigation</title> <script src="/js-test-resources/js-test.js"></script> +<script src='../../../media-resources/media-file.js'></script> <script> var jsTestIsAsync = true; function tearDown(result) { @@ -11,7 +12,7 @@ function runVideoTest() { var video = document.createElement('video'); - video.src = "/resources/test.ogv"; + video.src = findMediaFile("video", "/resources/test"); video.play().then(tearDown, tearDown); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-add-hide.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-add-hide.html index af8342e..ff3ec55 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-add-hide.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-add-hide.html
@@ -2,6 +2,7 @@ <title>Test adding keywords to controlsList hides buttons</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <script src="../../media-resources/media-controls.js"></script> <video controls id="enabled-controls" width="500px"></video> <script> @@ -26,6 +27,6 @@ })); })); - v.src = '../resources/test.ogv'; + v.src = findMediaFile('video', '../resources/test'); }, 'Test disabling controls on the video element with all controls.'); </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-remove-show.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-remove-show.html index 60880ee..2244b722 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-remove-show.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-remove-show.html
@@ -2,6 +2,7 @@ <title>Test removing keywords from controlsList shows buttons</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <script src="../../media-resources/media-controls.js"></script> <video controlslist="nodownload nofullscreen" id="disabled-controls" width="500px"></video> <script> @@ -27,7 +28,7 @@ })); })); - v.src = '../resources/test.ogv'; + v.src = findMediaFile('video', '../resources/test'); }, 'Test enabling controls on the video element with them enabled.'); </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source-buffer.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source-buffer.html index d9109aa..e175b8c 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source-buffer.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source-buffer.html
@@ -15,7 +15,7 @@ checkControlsClassName(video, "phase-ready state-buffering"); }); - const mediaFile = "../../../media/" + "content/test.ogv"; + const mediaFile = "../../../media/" + findMediaFile("video", "content/test"); const mimeType = mimeTypeForFile(mediaFile); video.src = "http://127.0.0.1:8000/resources/load-and-stall.php?name=" + mediaFile + "&mimeType=" + mimeType + "&stallAt=100000&stallFor=8";
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source.html index 2751f78..947da096 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source.html
@@ -4,6 +4,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../../../media-resources/media-controls.js"></script> +<script src="../../../media-resources/media-file.js"></script> <video controls width=400 preload=metadata></video> <script> async_test(t => {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-correct-ordering.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-correct-ordering.html index 332cbe6f..3aa5fa3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-correct-ordering.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-correct-ordering.html
@@ -3,6 +3,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../../../media-resources/media-controls.js"></script> +<script src="../../../media-resources/media-file.js"></script> <script src="../../../media-resources/overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "../resources/test.ogv"; + video.src = findMediaFile("video", "../resources/test"); video.setAttribute("width", "60"); // Add captions var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-updates-appropriately.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-updates-appropriately.html index 6f6079b..8b1f18e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-updates-appropriately.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-updates-appropriately.html
@@ -3,6 +3,7 @@ <script src='../../resources/testharness.js'></script> <script src='../../resources/testharnessreport.js'></script> <script src='../../../media-resources/media-controls.js'></script> +<script src='../../../media-resources/media-file.js'></script> <script src='../../../media-resources/overflow-menu.js'></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -14,7 +15,7 @@ // Set up video var video = document.querySelector('video'); - video.src = '../resources/test.ogv'; + video.src = findMediaFile('video', '../resources/test'); video.setAttribute('width', '60'); // Add captions var trackElement = document.createElement('track');
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/gc-while-network-loading.html b/third_party/WebKit/LayoutTests/http/tests/media/gc-while-network-loading.html index 31f8b40..e34ad50 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/gc-while-network-loading.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/gc-while-network-loading.html
@@ -8,7 +8,7 @@ { var v = document.createElement("video"); v.foo = "bar"; - var mediaFile = "../../../media/content/test.ogv"; + var mediaFile = findMediaFile("video", "../../../media/content/test"); var type = mimeTypeForExtension(mediaFile.split(".").pop()); v.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + mediaFile + "&throttle=50&type=" + type; v.onloadstart = t.step_func(function()
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-document.html b/third_party/WebKit/LayoutTests/http/tests/media/media-document.html index 4802aa12..e29eac4 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/media-document.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-document.html
@@ -6,7 +6,7 @@ <body> <script> async_test(function(t) { - var movie = 'test.ogv'; + var movie = findMediaFile('video', 'test'); var type = mimeTypeForExtension(movie.split('.').pop()); var iframe = document.createElement('iframe');
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer-expected.txt new file mode 100644 index 0000000..dbcd6b5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer-expected.txt
@@ -0,0 +1,16 @@ +CONSOLE WARNING: line 16: Ignore this warning. See https://crbug.com/568704#c2 +This is a testharness.js-based test. +PASS Test addSourceBuffer() in 'ended' state. +PASS Test addSourceBuffer() with empty type +PASS Test addSourceBuffer() with null +PASS Test addSourceBuffer() with unsupported type +PASS Test addSourceBuffer() with Vorbis and VP8 +PASS Test addSourceBuffer() with Vorbis and VP8 in separate SourceBuffers +PASS Test addSourceBuffer() video only +PASS Test addSourceBuffer() audio only +FAIL Test addSourceBuffer() with AAC and H.264 assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported expected true got false +FAIL Test addSourceBuffer() with AAC and H.264 in separate SourceBuffers assert_true: video/mp4;codecs="avc1.4D4001" is supported expected true got false +PASS Test addSourceBuffer() throws QuotaExceededError after MediaSource has completed init. +PASS Test addSourceBuffer() succeeds while incomplete init segment is appended, fails after MediaSource init completed. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt index a07603d..fa56a24 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt
@@ -1,5 +1,4 @@ -CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2 This is a testharness.js-based test. -PASS Tests mp4 audio-only bitrate changes. +FAIL Tests mp4 audio-only bitrate changes. assert_true: audio/mp4;codecs="mp4a.40.2" is supported. expected true got false Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt index 48ad7c5..2b7793b3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt
@@ -1,5 +1,4 @@ -CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2 This is a testharness.js-based test. -PASS Tests mp4 audio bitrate changes in multiplexed content. +FAIL Tests mp4 audio bitrate changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-framesize-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-framesize-expected.txt index 272d3aa..3e82c6e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-framesize-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-framesize-expected.txt
@@ -1,5 +1,4 @@ -CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2 This is a testharness.js-based test. -PASS Tests mp4 frame size changes in multiplexed content. +FAIL Tests mp4 frame size changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt index 536d6ac..8efe81a 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt
@@ -1,5 +1,4 @@ -CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2 This is a testharness.js-based test. -PASS Tests mp4 video bitrate changes in multiplexed content. +FAIL Tests mp4 video bitrate changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt index 700eeed..8f53878c6 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt
@@ -1,5 +1,4 @@ -CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2 This is a testharness.js-based test. -PASS Tests mp4 video-only bitrate changes. +FAIL Tests mp4 video-only bitrate changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framerate-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framerate-expected.txt index f22b5e1..61e3e73 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framerate-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framerate-expected.txt
@@ -1,5 +1,4 @@ -CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2 This is a testharness.js-based test. -PASS Tests mp4 video-only frame rate changes. +FAIL Tests mp4 video-only frame rate changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framesize-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framesize-expected.txt index be280a98..9f613a78 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framesize-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framesize-expected.txt
@@ -1,5 +1,4 @@ -CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2 This is a testharness.js-based test. -PASS Tests mp4 video-only frame size changes. +FAIL Tests mp4 video-only frame size changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-is-type-supported-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-is-type-supported-expected.txt index 143b4d2a..35e804b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-is-type-supported-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-is-type-supported-expected.txt
@@ -30,14 +30,14 @@ PASS Test valid WebM type "video/webm;codecs="vorbis, vp8"" PASS Test valid WebM type "audio/webm;codecs="vorbis"" PASS Test valid WebM type "AUDIO/WEBM;CODECS="vorbis"" -PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e"" -PASS Test valid MP4 type "video/mp4;codecs="avc1.42001e"" -PASS Test valid MP4 type "audio/mp4;codecs="mp4a.40.2"" -PASS Test valid MP4 type "audio/mp4;codecs="mp4a.40.5"" -PASS Test valid MP4 type "audio/mp4;codecs="mp4a.67"" -PASS Test valid MP4 type "video/mp4;codecs="mp4a.40.2"" -PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.2"" -PASS Test valid MP4 type "video/mp4;codecs="mp4a.40.2 , avc1.4d001e "" -PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.5"" +FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "video/mp4;codecs="avc1.42001e"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.40.2"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.40.5"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.67"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "video/mp4;codecs="mp4a.40.2"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.2"" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "video/mp4;codecs="mp4a.40.2 , avc1.4d001e "" assert_equals: supported expected true but got false +FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.5"" assert_equals: supported expected true but got false Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/mixed-range-response.html b/third_party/WebKit/LayoutTests/http/tests/media/mixed-range-response.html index 637f37c4..f3a8c88 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/mixed-range-response.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/mixed-range-response.html
@@ -2,6 +2,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../resources/get-host-info.js"></script> +<script src="../../media-resources/media-file.js"></script> <body> <script> // This file tests the following behavior:
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html b/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html index 99e3a31..7623ca0 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html
@@ -2,6 +2,7 @@ <title>Tests that a PDF file is served as "application/pdf"</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <video></video> <script> async_test(function(t) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/preload-conditions.html b/third_party/WebKit/LayoutTests/http/tests/media/preload-conditions.html index 362959fb..29f9182 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/preload-conditions.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/preload-conditions.html
@@ -2,6 +2,7 @@ <title>Test media preloading behaviour with different conditions.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <script> var tests = [ { @@ -134,7 +135,7 @@ [ '', 'none', 'metadata', 'auto' ].forEach(preload => { var media = document.createElement('video'); media.preload = preload; - media.src = 'resources/test.ogv'; + media.src = findMediaFile('video', 'resources/test'); assert_equals(media.readyState, HTMLMediaElement.HAVE_NOTHING); switch (media.preload) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html b/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html index 93299e9..a9147c2 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html
@@ -68,7 +68,7 @@ setTimeout(t.step_func(checkProgressCount), maxProgressFiringIntervalInMS); }); - var mediaFile = 'resources/test.ogv'; + var mediaFile = findMediaFile('video', 'resources/test'); var mimeType = mimeTypeForFile(mediaFile); // Assumes minimum file size selected is > 100 kB. // At least 4*maxProgressFiringIntervalInMS is how long we want to stretch the full
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html b/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html index 285952a..c6518f1 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html
@@ -2,6 +2,7 @@ <title>Test that video is not reloaded on showing a dialog.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <video></video> <script> // Make sure we don't reload a "video" element after a dialog is shown. @@ -9,7 +10,7 @@ // "loadstart" event handler is called. If the movie is reloaded when // the dialog is "dismissed", another "loadstart" event will be fired. async_test(function(t) { - var movie = "../resources/test.ogv"; + var movie = findMediaFile("video", "../resources/test"); var video = document.querySelector("video"); video.onloadstart = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html b/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html index b70643c..d990655 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html
@@ -13,7 +13,7 @@ setTimeout(t.step_func_done(), 100); }); - var mediaFile = "content/test.ogv"; + var mediaFile = findMediaFile("video", "content/test"); var mimeType = mimeTypeForFile(mediaFile); video.src = "http://127.0.0.1:8000/resources/load-and-stall.php?name=../../../media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=100000"; });
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html b/third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html index 1e99cfe..27797563 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html
@@ -1,4 +1,5 @@ <!DOCTYPE html> +<script src="../../../media-resources/media-file.js"></script> <body></body> <script> window.internals.settings.setAutoplayPolicy('user-gesture-required-for-cross-origin'); @@ -7,7 +8,7 @@ { var video = document.createElement('video'); video.id = 'video'; - video.src = 'test.ogv'; + video.src = findMediaFile('video', 'test'); video.autoplay = true; video.loop = true; document.body.appendChild(video); @@ -16,7 +17,7 @@ { var video = document.createElement('video'); video.id = 'video-muted'; - video.src = 'test.ogv'; + video.src = findMediaFile('video', 'test'); video.muted = true; video.autoplay = true; video.loop = true;
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html b/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html index 5263da1..9631716 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html
@@ -2,6 +2,7 @@ <title>Tests that a text file is served as "text/plain".</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <video></video> <script> async_test(function(t) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html index 8bbcd66..862c90a3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html
@@ -23,7 +23,7 @@ video.currentTime = video.duration - 0.5; }; -var mediaFile = "../../../media/content/test.oga"; +var mediaFile = findMediaFile("audio", "../../../media/content/test"); var type = mimeTypeForExtension(mediaFile.split(".").pop()); video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + mediaFile + "&throttle=5000&nph=1&type=" + type; </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html b/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html index a3528ae..70dd2fa 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Cancel loading a video file and access its properties afterwards.</title> +<script src="../../media-resources/media-file.js"></script> <video></video> <textarea style="display: none;"> @@ -34,7 +35,7 @@ doc.close(); }; -var file = "../resources/test.ogv"; +var file = findMediaFile("video", "../resources/test"); video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?throttle=40&name=" + file; // Change URL of the current page to a blank page.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-displayed.html b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-displayed.html index 38ff5737..20409084 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-displayed.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-displayed.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../../media-resources/media-controls.js"></script> +<script src="../../media-resources/media-file.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> <body style="padding-top: 200px; padding-left: 100px"> <video controls></video> @@ -10,7 +11,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "resources/test.ogv"; + video.src = findMediaFile("video", "resources/test"); var controlID = "-internal-media-controls-download-button"; var downloadButton = mediaControlsElement(internals.shadowRoot(video).firstChild, controlID); video.onloadeddata = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-not-displayed-hide-download-ui.html b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-not-displayed-hide-download-ui.html index 2c7c356abd..cc20b092 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-not-displayed-hide-download-ui.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-not-displayed-hide-download-ui.html
@@ -3,12 +3,13 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../../media-resources/media-controls.js"></script> +<script src="../../media-resources/media-file.js"></script> <video controls></video> <script> async_test(function(t) { window.internals.settings.setHideDownloadUI(true); var video = document.querySelector("video"); - video.src = "resources/test.ogv"; + video.src = findMediaFile("video", "resources/test"); var controlID = "-internal-media-controls-download-button"; var downloadButton = mediaControlsElement(internals.shadowRoot(video).firstChild, controlID); video.onloadeddata = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media-cross-origin.html b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media-cross-origin.html index 0b11f670..cc88f698 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media-cross-origin.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media-cross-origin.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../../media-resources/media-controls.js"></script> +<script src="../../media-resources/media-file.js"></script> <script src="../../media-resources/overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> <body style="padding-top: 200px; padding-left: 100px"> @@ -16,7 +17,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "http://localhost:8000/media/resources/test.ogv"; + video.src = findMediaFile("video", "http://localhost:8000/media/resources/test"); var controlID = "-internal-media-controls-download-button"; var downloadButton = mediaControlsElement(internals.shadowRoot(video).firstChild, controlID);
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media.html b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media.html index fa9bb78..480d859 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../../media-resources/media-controls.js"></script> +<script src="../../media-resources/media-file.js"></script> <script src="../../media-resources/overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> <body style="padding-top: 200px; padding-left: 100px"> @@ -16,7 +17,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "resources/test.ogv"; + video.src = findMediaFile("video", "resources/test"); var controlID = "-internal-media-controls-download-button"; var downloadButton = mediaControlsElement(internals.shadowRoot(video).firstChild, controlID);
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-download-button.html b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-download-button.html index 7badd4f..1fa9599 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-download-button.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-download-button.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../../media-resources/media-controls.js"></script> +<script src="../../media-resources/media-file.js"></script> <script src="../../media-resources/overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> <body style="padding-top: 200px; padding-left: 100px"> @@ -14,7 +15,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "resources/test.ogv"; + video.src = findMediaFile("video", "resources/test"); video.setAttribute("width", "60"); var controlID = "-internal-media-controls-download-button";
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html b/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html index a32ed19..7478c13 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html
@@ -2,11 +2,12 @@ <title>Tests that the media player will send the relevant cookies when requesting the media file.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <body> <video></video> <script> async_test(function(t) { - var movie = "resources/test.ogv"; + var movie = findMediaFile("video", "resources/test"); var frame = document.createElement("iframe"); document.body.appendChild(frame);
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html b/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html index 0117958..e1284898 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html
@@ -2,6 +2,7 @@ <title>Test "abort" event.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -25,7 +26,7 @@ assert_equals(video.error, null); })); - var movie = "../resources/test.ogv"; + var movie = findMediaFile("video", "../resources/test"); video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=256"; }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html index 3d6896355..cd3f0200 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html
@@ -12,7 +12,7 @@ watcher.wait_for(["loadedmetadata", "error"]).then(t.step_func_done(function() { assert_equals(video.networkState, HTMLMediaElement.NETWORK_IDLE); })); - var movie = "resources/test.ogv"; + var movie = findMediaFile("video", "resources/test"); var type = mimeTypeForExtension(movie.split(".").pop()); video.src = "video-load-metadata-decode-error.cgi?name=" + movie + "&type=" + type; video.play();
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html index 831e76a5..71a7186 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html
@@ -2,11 +2,12 @@ <title>Test that the load eventually suspends and returns to NETWORK_IDLE.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "http://127.0.0.1:8000/resources/test.ogv"; + video.src = findMediaFile("video", "http://127.0.0.1:8000/resources/test"); var watcher = new EventWatcher(t, video, ["loadstart", "suspend"]); watcher.wait_for(["loadstart", "suspend"]).then(t.step_func_done(function() { assert_equals(video.networkState, HTMLMediaElement.NETWORK_IDLE);
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html index 1425414..f89f1bd 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html
@@ -2,10 +2,11 @@ <title>Test loading video twice.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <body> <script> async_test(function(t) { - var file = "http://127.0.0.1:8000/resources/test.ogv"; + var file = findMediaFile("video", "http://127.0.0.1:8000/resources/test"); createAndLoadVideo(false); function createAndLoadVideo(endTest) { var video = document.createElement("video");
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html index e586a2f..34bac02 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html
@@ -15,7 +15,7 @@ video.onerror = t.unreached_func(); video.oncanplay = t.step_func_done(); - var movie = 'test.ogv'; + var movie = findMediaFile('video', 'test'); var type = mimeTypeForExtension(movie.split('.').pop()); source = document.querySelector('source'); source.type = type;
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html index fea4ef3..68cedea 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html
@@ -2,6 +2,7 @@ <title>Test that at least one progress event is fired after starting to load the video.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -10,7 +11,7 @@ var watcher = new EventWatcher(t, video, ["loadstart", "progress"]); watcher.wait_for(["loadstart", "progress"]).then(t.step_func_done()); - var mediaFile = "resources/test.ogv"; + var mediaFile = findMediaFile("video", "resources/test"); video.src = "http://127.0.0.1:8000/" + mediaFile; video.play(); });
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html index 879e522..f1363f3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
@@ -16,7 +16,7 @@ })); // Find a supported media file. - var mediaFile = "content/test.ogv"; + var mediaFile = findMediaFile("video", "content/test"); var mimeType = mimeTypeForFile(mediaFile); // Load should stall very early in the loading process.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html index 91424e4..d445f59 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html
@@ -126,7 +126,7 @@ // Find a supported media file. - var mediaFile = "content/test.ogv"; + var mediaFile = findMediaFile("video", "content/test"); var mimeType = mimeTypeForFile(mediaFile); // URL will load part of the file, pause for 8 seconds, then load the rest. // The delay of 8 seconds is chosen to reduce flakiness in waiting for the
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-preload-metadata.html b/third_party/WebKit/LayoutTests/http/tests/media/video-preload-metadata.html index d7558405..d4a7cdfd 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-preload-metadata.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-preload-metadata.html
@@ -2,6 +2,7 @@ <title>Verifies preload=metadata doesn't buffer the entire clip.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <div id="log"></div> <video controls preload=metadata></video> <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html b/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html index c1dd2d7..e4255a4 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html
@@ -10,7 +10,7 @@ var iframe = document.createElement('iframe'); iframe.onload = t.step_func(function() { - var movie = 'test.ogv'; + var movie = findMediaFile('video', 'test'); var type = mimeTypeForExtension(movie.split('.').pop()); var video = document.querySelector('video'); video.onerror = t.unreached_func();
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html b/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html index 113433a29..2949aca 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html
@@ -9,7 +9,7 @@ </video> <script> async_test(function(t) { - var movie = 'test.ogv'; + var movie = findMediaFile('video', 'test'); var type = mimeTypeForExtension(movie.split('.').pop()); var iframe = document.createElement('iframe');
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html index fd82e9c..ba61b9c7 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html
@@ -2,6 +2,7 @@ <title>Test event dispatches and attribute changes for seek to duration.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -47,7 +48,7 @@ assert_equals(video.currentTime, video.duration); } - video.src = "resources/test.ogv";; + video.src = findMediaFile("video", "resources/test");; video.play(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html index 33bdae3..759e784e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html
@@ -2,6 +2,7 @@ <title>Test event dispatches and attribute changes for seek to middle.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -45,7 +46,7 @@ assert_false(video.paused); } - video.src = "resources/test.ogv"; + video.src = findMediaFile("video", "resources/test"); video.play(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html b/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html index 85cac6db..9fc3e16 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html
@@ -2,6 +2,7 @@ <title>Tests that a media file is served as "text/plain".</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="../../media-resources/media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -11,7 +12,7 @@ watcher.wait_for(["loadstart", "loadedmetadata"]).then(t.step_func_done()); assert_equals(video.error, null); - var movie = "resources/test.ogv"; + var movie = findMediaFile("video", "resources/test"); video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=99999&type=text/plain"; }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html b/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html index 293b4c2..1197a820 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html
@@ -9,7 +9,7 @@ </video> <script> async_test(function(t) { - var movie = 'test.ogv'; + var movie = findMediaFile('video', 'test'); var type = mimeTypeForExtension(movie.split('.').pop()); var iframe = document.createElement('iframe');
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote-expected.txt index 2e81681..91b0c1dc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE ERROR: Not allowed to load local resource: test.ogv +CONSOLE ERROR: Not allowed to load local resource: test.mp4 Test that a remote video element will not use a local <source>, and will use another remote <source> This test only behaves correctly in DRT
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote.html b/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote.html index 19fcd84..ed531c3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote.html +++ b/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote.html
@@ -14,13 +14,13 @@ consoleWrite("<br>END OF TEST"); testEnded = true; if (window.testRunner) - testRunner.notifyDone(); + testRunner.notifyDone(); } function hanged() { consoleWrite("FAIL: timed out"); if (window.testRunner) - testRunner.notifyDone(); + testRunner.notifyDone(); } function logConsole() @@ -31,7 +31,7 @@ } return console; } - + function consoleWrite(text) { if (testEnded) @@ -60,25 +60,24 @@ endTest(); } - var localMovie = "file:///tmp/LayoutTests/media/content/test.ogv"; - var remoteUrl = "http://localhost:8000/resources/test.ogv"; + var localMovie = "file:///tmp/LayoutTests/media/content/test.mp4"; + var remoteUrl = "http://localhost:8000/resources/test"; - function loadedmetadata(evt) - { + function loadedmetadata(evt) + { var src = video.currentSrc; + var localFile = localMovie.substring(localMovie.lastIndexOf("/")+1, localMovie.length) + var remoteFile = remoteUrl.substring(remoteUrl.lastIndexOf("/")+1, remoteUrl.length) logEvent(evt); - if (src == localMovie) + if (src.indexOf(localFile) > 0) logResult("local movie loaded", false); - else if (src == remoteUrl) + else if (src.indexOf(remoteFile) > 0) logResult("remote movie loaded, local movie failed to load", true); - else - logResult("video failed to load any movie", false); - endTest(); } - if (window.testRunner) + if (window.testRunner) { localMovie = testRunner.pathToLocalResource(localMovie); testRunner.dumpAsText(); @@ -86,7 +85,7 @@ } setTimeout(hanged, 10000); - function test() + function test() { video = document.getElementById("vid"); @@ -98,6 +97,15 @@ var src1 = document.createElement("source"); src1.setAttribute("src", localMovie); + if (video.canPlayType("video/mp4")) + remoteUrl += ".mp4"; + else if (video.canPlayType("video/ogg")) + remoteUrl += ".ogv"; + else { + logResult("Missing test movie for this platform???", false); + endTest(); + } + var src2 = document.createElement("source"); src2.setAttribute("src", remoteUrl); @@ -105,7 +113,7 @@ video.appendChild(src2); } </script> - + </head> <body onLoad="test()">
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html index e303246..5809bbce 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html +++ b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html
@@ -7,7 +7,7 @@ <script> async_test(function(t) { var video = document.querySelector("video"); - var mediaFile = "../../media/resources/test.ogv"; + var mediaFile = findMediaFile("video", "../../media/resources/test"); var type = mimeTypeForExtension(mediaFile.split('.').pop()); video.onerror = t.unreached_func();
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html index 7a692cf7..4b1cbc9e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html +++ b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html
@@ -16,7 +16,7 @@ }); document.body.appendChild(video); - var mediaFile = "../../media/resources/test.ogv"; + var mediaFile = findMediaFile("video", "../../media/resources/test"); var type = mimeTypeForExtension(mediaFile.split('.').pop()); video.src = "http://localhost:8080/security/resources/video-cross-origin-allow.php?no-preflight&name=" + mediaFile + "&type=" + type; video.play();
diff --git a/third_party/WebKit/LayoutTests/media/W3C/audio/canPlayType/canPlayType_supported_but_no_codecs_parameter_2-expected.txt b/third_party/WebKit/LayoutTests/media/W3C/audio/canPlayType/canPlayType_supported_but_no_codecs_parameter_2-expected.txt index c10c22c2..045897d 100644 --- a/third_party/WebKit/LayoutTests/media/W3C/audio/canPlayType/canPlayType_supported_but_no_codecs_parameter_2-expected.txt +++ b/third_party/WebKit/LayoutTests/media/W3C/audio/canPlayType/canPlayType_supported_but_no_codecs_parameter_2-expected.txt
@@ -3,7 +3,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS "maybe" is "maybe" PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3-expected.txt b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3-expected.txt index 6dd503b..d9e6648 100644 --- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3-expected.txt +++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3-expected.txt
@@ -4,7 +4,6 @@ PASS "" is "" -PASS "probably" is "probably" PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3.html b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3.html index ecd3f46d..b80b1e98 100644 --- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3.html +++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3.html
@@ -13,13 +13,8 @@ test(function() { var v = document.getElementById("v"); assert_equals( - v.canPlayType('video/webm; codecs="vp8, BOGUS"'), - v.canPlayType('video/webm; codecs="BOGUS, vp8"'), - "order of codecs parameters should have no effect"); - - assert_equals( - v.canPlayType('video/webm; codecs="vp8, opus"'), - v.canPlayType('video/webm; codecs="opus, vp8"'), + v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'), + v.canPlayType('video/mp4; codecs="mp4a.40.2, avc1.42E01E"'), "order of codecs parameters should have no effect"); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_supported_but_no_codecs_parameter_3-expected.txt b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_supported_but_no_codecs_parameter_3-expected.txt index f4c736f..0c1ece3e 100644 --- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_supported_but_no_codecs_parameter_3-expected.txt +++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_supported_but_no_codecs_parameter_3-expected.txt
@@ -3,7 +3,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS "maybe" is "maybe" PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5-expected.txt b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5-expected.txt index aea6276f..ba70851 100644 --- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5-expected.txt +++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5-expected.txt
@@ -3,7 +3,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS "probably" is "probably" PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5.html b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5.html index d2cac6e5..85afb61f 100644 --- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5.html +++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5.html
@@ -15,7 +15,7 @@ if (v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"') == "probably") { assert_equals( v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'), - v.canPlayType('video/mp4; codecs="avc1.42E01E"'), + v.canPlayType('video/ogg; codecs="avc1.42E01E"'), "ability to play two codecs implies the ability to play one"); } });
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6-expected.txt b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6-expected.txt index aea6276f..ba70851 100644 --- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6-expected.txt +++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6-expected.txt
@@ -3,7 +3,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS "probably" is "probably" PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6.html b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6.html index 3d4a59dc..2b615f1 100644 --- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6.html +++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6.html
@@ -15,7 +15,7 @@ if (v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"') == "probably") { assert_equals( v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'), - v.canPlayType('video/mp4; codecs="mp4a.40.2"'), + v.canPlayType('video/ogg; codecs="mp4a.40.2"'), "ability to play two codecs implies the ability to play one"); } });
diff --git a/third_party/WebKit/LayoutTests/media/adopt-node-crash.html b/third_party/WebKit/LayoutTests/media/adopt-node-crash.html index c9bc0ede..1a02439 100644 --- a/third_party/WebKit/LayoutTests/media/adopt-node-crash.html +++ b/third_party/WebKit/LayoutTests/media/adopt-node-crash.html
@@ -50,7 +50,7 @@ { var video = document.getElementsByTagName('video')[0]; video.addEventListener("loadstart", loadstart); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html b/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html index e41b2ec..ecffca8 100644 --- a/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html +++ b/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html
@@ -2,6 +2,7 @@ <title>Test that multiple audio elements can play concurrently.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> async_test(function(t) { // Number of concurrent audio elements to test. @@ -45,7 +46,7 @@ } }); - audioElement.src = "content/silence.oga"; + audioElement.src = findMediaFile("audio", "content/silence"); } }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html b/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html index 6dfbbb6..ae635c7 100644 --- a/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html +++ b/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that Audio() sets "preload" attribute.</title> +<script src="media-file.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script> @@ -15,7 +16,7 @@ assert_equals(audio.preload, "auto"); }); - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.load(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/audio-constructor-src.html b/third_party/WebKit/LayoutTests/media/audio-constructor-src.html index c30a1036..0cebeb8 100644 --- a/third_party/WebKit/LayoutTests/media/audio-constructor-src.html +++ b/third_party/WebKit/LayoutTests/media/audio-constructor-src.html
@@ -1,10 +1,11 @@ <!DOCTYPE html> <title>Test that Audio("url") constructor loads the specified resource.</title> +<script src="media-file.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script> async_test(function(t) { - var audioFile = "content/test.oga"; + var audioFile = findMediaFile("audio", "content/test"); var audio = new Audio(audioFile); audio.onloadstart = t.step_func(function () {
diff --git a/third_party/WebKit/LayoutTests/media/audio-constructor.html b/third_party/WebKit/LayoutTests/media/audio-constructor.html index de7d252..dadaf589 100644 --- a/third_party/WebKit/LayoutTests/media/audio-constructor.html +++ b/third_party/WebKit/LayoutTests/media/audio-constructor.html
@@ -1,12 +1,13 @@ <!DOCTYPE html> <title>Test that Audio() object loads the resource after src attribute is set and load() is called.</title> +<script src="media-file.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script> async_test(function(t) { var audio = new Audio(); - var audioFile = "content/test.oga"; + var audioFile = findMediaFile("audio", "content/test"); audio.src = audioFile; audio.onloadstart = t.step_func(function () { var url = audio.currentSrc;
diff --git a/third_party/WebKit/LayoutTests/media/audio-controls-captions.html b/third_party/WebKit/LayoutTests/media/audio-controls-captions.html index 70b1714..cdfd5e3 100644 --- a/third_party/WebKit/LayoutTests/media/audio-controls-captions.html +++ b/third_party/WebKit/LayoutTests/media/audio-controls-captions.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests that the closed captions button is not visible.</title> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> @@ -9,7 +10,7 @@ <script> async_test(function(t) { var audio = document.querySelector('audio'); - audio.src = 'content/test.oga'; + audio.src = findMediaFile('audio', 'content/test'); audio.onloadedmetadata = t.step_func_done(function() { assert_false(isClosedCaptionsButtonVisible(audio)); });
diff --git a/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html b/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html index b35f37c..920ae6792 100644 --- a/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html +++ b/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>This tests that audio controls do not fade out when the audio is playing.</title> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> @@ -7,7 +8,7 @@ <script> async_test(function(t) { var audio = document.querySelector("audio"); - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.onplaying = t.step_func(function() { runAfterHideMediaControlsTimerFired(t.step_func_done(controlsTimerFired), audio); });
diff --git a/third_party/WebKit/LayoutTests/media/audio-controls-rendering.html b/third_party/WebKit/LayoutTests/media/audio-controls-rendering.html index 997a5612..19636d3d 100644 --- a/third_party/WebKit/LayoutTests/media/audio-controls-rendering.html +++ b/third_party/WebKit/LayoutTests/media/audio-controls-rendering.html
@@ -1,18 +1,18 @@ <html> <head> <style> - audio { background-color: blue; } + audio { background-color: blue; } </style> <script src=media-file.js></script> <script> function test() { - setSrcByTagName("audio", "content/test.oga"); + setSrcByTagName("audio", findMediaFile("audio", "content/test")); if (window.testRunner) { testRunner.waitUntilDone(); - setTimeout(function() { - document.body.appendChild(document.createTextNode('FAIL')); + setTimeout(function() { + document.body.appendChild(document.createTextNode('FAIL')); if (window.testRunner) testRunner.notifyDone(); } , 8000);
diff --git a/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html b/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html index 2f69e86..3f8a1f8 100644 --- a/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html +++ b/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>This tests that events don't continue to target a slider thumb if the media element is deleted while scrubbing.</title> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> @@ -8,7 +9,7 @@ <script> async_test(function(t) { var audio = document.querySelector("audio"); - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.onplaying = t.step_func(function() { var seekCoords = mediaControlsButtonCoordinates(audio, "timeline"); var x = seekCoords[0];
diff --git a/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html b/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html index 59b1db4..148cbd2 100644 --- a/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html +++ b/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html
@@ -1,5 +1,6 @@ <!DOCTYPE HTML> <title>Tests that we don't garbage collect audio object while it is still playing.</title> +<script src="media-file.js"></script> <script src="../resources/gc.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> @@ -14,9 +15,9 @@ async_test(function(t) { var audioPlayers = 4; var playedCount = 0; - var audioFile = "content/silence.oga"; + var audioFile = findMediaFile("audio", "content/silence"); var audio = new Audio(audioFile); - + audio.onended = t.step_func(function() { playedCount ++; if (playedCount <= audioPlayers) {
diff --git a/third_party/WebKit/LayoutTests/media/audio-play-event.html b/third_party/WebKit/LayoutTests/media/audio-play-event.html index f940518..906651c 100644 --- a/third_party/WebKit/LayoutTests/media/audio-play-event.html +++ b/third_party/WebKit/LayoutTests/media/audio-play-event.html
@@ -1,5 +1,6 @@ <!DOCTYPE HTML> <title>Test that a 'play' event is fired by a new audio element on playing.</title> +<script src="media-file.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script> @@ -10,7 +11,7 @@ audio.oncanplay = t.step_func(function() {}); audio.onplaying = t.step_func_done(); audio.onerror = t.unreached_func("Should not fire 'error' event"); - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.play(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html b/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html index 624eafc..49f263ef8 100644 --- a/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html +++ b/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html
@@ -2,6 +2,7 @@ <title>Test that play event fires when "src" set with an autoplay attribute in a sandbox with allows-scripts.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <iframe sandbox="allow-scripts allow-same-origin" src="resources/auto-play-in-sandbox-with-allow-scripts-iframe.html"> @@ -14,7 +15,7 @@ var video = iframe.contentDocument.querySelector("video"); assert_true(video.paused); video.onplay = t.step_func_done(); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-clears-autoplaying-flag.html b/third_party/WebKit/LayoutTests/media/autoplay-clears-autoplaying-flag.html index f8b413ed..a6c5ba5 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-clears-autoplaying-flag.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-clears-autoplaying-flag.html
@@ -2,6 +2,7 @@ <title>autoplay clears the autoplaying flag</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> async_test(function(t) {
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-document-move.html b/third_party/WebKit/LayoutTests/media/autoplay-document-move.html index 8047a64..cd55571 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-document-move.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-document-move.html
@@ -2,11 +2,12 @@ <title>Moving media element to other document to bypass autoplay</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <body> <script> function createAndMoveVideo() { var v = document.implementation.createHTMLDocument().createElement('video'); - v.src = 'content/test.ogv'; + v.src = findMediaFile('video', 'content/test'); document.body.appendChild(v); return v; }
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-from-mediastream-to-src.html b/third_party/WebKit/LayoutTests/media/autoplay-from-mediastream-to-src.html index 2e653ba..41031e0 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-from-mediastream-to-src.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-from-mediastream-to-src.html
@@ -2,6 +2,7 @@ <title>Test for autoplay of video once the media stream is set to null</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> test(function() { assert_true(!!window.internals && !!window.internals.settings, @@ -16,7 +17,7 @@ setTimeout(t.step_func(function() { v.srcObject = null; - v.src = 'content/test.ogv'; + v.src = findMediaFile('video', 'content/test'); v.play() .then(t.unreached_func('The video must not play without user gesture.'))
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-muted-conditions.html b/third_party/WebKit/LayoutTests/media/autoplay-muted-conditions.html index 16596495..8a0e837 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-muted-conditions.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-muted-conditions.html
@@ -2,6 +2,7 @@ <title>Test autoplay muted behaviour in various system conditions.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <body></body> <script> var tests = [ @@ -127,7 +128,7 @@ }); media.muted = true; - media.src = 'content/test.ogv'; + media.src = findMediaFile('video', 'content/test'); if (type == 'attribute') media.autoplay = true;
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-off.html b/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-off.html index 483cd09..6a71af3 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-off.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-off.html
@@ -4,7 +4,8 @@ <title>Test muted autoplay videos interaction with data saver on</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> - </head> + <script src="media-file.js"></script> +</head> <body> <script> window.internals.settings.setAutoplayPolicy('user-gesture-required'); @@ -14,7 +15,7 @@ promise_test(function(t) { var video = document.createElement('video'); - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); video.muted = true; return video.play(); });
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html b/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html index 23be1ac..b72990d 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html
@@ -4,7 +4,8 @@ <title>Test muted autoplay videos interaction with data saver on</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> - </head> + <script src="media-file.js"></script> +</head> <body> <script> window.internals.settings.setAutoplayPolicy('user-gesture-required'); @@ -14,7 +15,7 @@ promise_test(function(t) { var video = document.createElement('video'); - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); video.muted = true; return promise_rejects(t, new DOMException('play() can only be initiated by a user gesture.',
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-muted.html b/third_party/WebKit/LayoutTests/media/autoplay-muted.html index cc5fdaf..424de18 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-muted.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-muted.html
@@ -2,6 +2,7 @@ <title>Test for autoplay of muted video</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <body> <script> @@ -19,7 +20,7 @@ function createMutedMediaElement(type) { var e = document.createElement(type); - e.src = type == 'audio' ? 'content/test.oga' : 'content/test.ogv'; + e.src = findMediaFile(type, 'content/test'); e.muted = true; return e; }
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-never-visible.html b/third_party/WebKit/LayoutTests/media/autoplay-never-visible.html index 3765e05..0cc7239 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-never-visible.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-never-visible.html
@@ -2,6 +2,7 @@ <title>Test behaviour of autoplay muted videos with regards to visibility</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <body> <script> window.internals.settings.setAutoplayPolicy('user-gesture-required'); @@ -12,7 +13,7 @@ { var video = document.createElement('video'); video.id = 'offscreen'; - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); video.muted = true; video.autoplay = true; video.loop = true;
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-non-whitelisted-scope.html b/third_party/WebKit/LayoutTests/media/autoplay-non-whitelisted-scope.html index 322f344..d98b9b9d 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-non-whitelisted-scope.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-non-whitelisted-scope.html
@@ -2,6 +2,7 @@ <title>Test for autoplay of whitelisted frames</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <body> <script> @@ -20,7 +21,7 @@ function createMediaElement(type) { var e = document.createElement(type); - e.src = type == 'audio' ? 'content/test.oga' : 'content/test.ogv'; + e.src = findMediaFile(type, 'content/test'); return e; }
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-unmute-offscreen.html b/third_party/WebKit/LayoutTests/media/autoplay-unmute-offscreen.html index df248c60..56b1a74 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-unmute-offscreen.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-unmute-offscreen.html
@@ -2,6 +2,7 @@ <title>Test that unmuting offscreen video will not allow it to autoplay</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <body> <script> window.internals.settings.setAutoplayPolicy('user-gesture-required'); @@ -12,7 +13,7 @@ { var video = document.createElement('video'); video.id = 'offscreen-unmute'; - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); video.muted = true; video.autoplay = true; video.loop = true; @@ -25,7 +26,7 @@ { var video = document.createElement('video'); video.id = 'offscreen-mute'; - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); video.muted = true; video.autoplay = true; video.loop = true;
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-when-visible-multiple-times.html b/third_party/WebKit/LayoutTests/media/autoplay-when-visible-multiple-times.html index c54d48e..7da22941 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-when-visible-multiple-times.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-when-visible-multiple-times.html
@@ -2,6 +2,7 @@ <title>Test behaviour of autoplay muted videos with regards to visibility</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <body> <script> window.internals.settings.setAutoplayPolicy('user-gesture-required'); @@ -38,7 +39,7 @@ // Create a video off screen. { video = document.createElement('video'); - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); video.muted = true; video.autoplay = true; video.loop = true;
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-when-visible.html b/third_party/WebKit/LayoutTests/media/autoplay-when-visible.html index 116a624b..fadc38b 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-when-visible.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-when-visible.html
@@ -2,6 +2,7 @@ <title>Test behaviour of autoplay muted videos with regards to visibility</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <body> <script> window.internals.settings.setAutoplayPolicy('user-gesture-required'); @@ -12,7 +13,7 @@ { var video = document.createElement('video'); video.id = 'offscreen'; - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); video.muted = true; video.autoplay = true; video.loop = true; @@ -25,7 +26,7 @@ { var video = document.createElement('video'); video.id = 'inscreen'; - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); video.muted = true; video.autoplay = true; video.loop = true; @@ -35,7 +36,7 @@ // Create an audio in screen. { var audio = document.createElement('audio'); - audio.src = 'content/test.oga'; + audio.src = findMediaFile('audio', 'content/test'); audio.muted = true; audio.autoplay = true; audio.loop = true; @@ -47,7 +48,7 @@ { var video = document.createElement('video'); video.id = 'offscreen-no-autoplay'; - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); video.muted = true; video.loop = true; video.style.position = 'absolute';
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-whitelisted-scope.html b/third_party/WebKit/LayoutTests/media/autoplay-whitelisted-scope.html index 849625e..e0817e9 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-whitelisted-scope.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-whitelisted-scope.html
@@ -2,6 +2,7 @@ <title>Test for autoplay of whitelisted frames</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <body> <script> @@ -21,7 +22,7 @@ function createMediaElement(type) { var e = document.createElement(type); - e.src = type == 'audio' ? 'content/test.oga' : 'content/test.ogv'; + e.src = findMediaFile(type, 'content/test'); return e; }
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-with-preload-none.html b/third_party/WebKit/LayoutTests/media/autoplay-with-preload-none.html index cc48eb7..3ce0437 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay-with-preload-none.html +++ b/third_party/WebKit/LayoutTests/media/autoplay-with-preload-none.html
@@ -2,6 +2,7 @@ <title>autoplay with preload set to none.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> function autoplay_test(tagName, src) { @@ -29,6 +30,6 @@ }, tagName + '.autoplay with preload="none"'); } -autoplay_test('audio', 'content/test.oga'); -autoplay_test('video', 'content/test.ogv'); +autoplay_test('audio', findMediaFile('audio', 'content/test')); +autoplay_test('video', findMediaFile('video', 'content/test')); </script>
diff --git a/third_party/WebKit/LayoutTests/media/autoplay.html b/third_party/WebKit/LayoutTests/media/autoplay.html index 3dbd455..5fc5231 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay.html +++ b/third_party/WebKit/LayoutTests/media/autoplay.html
@@ -3,6 +3,7 @@ <title>autoplay</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> function autoplay_test(tagName, src) { @@ -29,6 +30,6 @@ }, tagName + '.autoplay'); } -autoplay_test('audio', 'content/test.oga'); -autoplay_test('video', 'content/test.ogv'); +autoplay_test('audio', findMediaFile('audio', 'content/test')); +autoplay_test('video', findMediaFile('video', 'content/test')); </script>
diff --git a/third_party/WebKit/LayoutTests/media/autoplay/document-user-activation.html b/third_party/WebKit/LayoutTests/media/autoplay/document-user-activation.html index 16635b4..e6de7b4 100644 --- a/third_party/WebKit/LayoutTests/media/autoplay/document-user-activation.html +++ b/third_party/WebKit/LayoutTests/media/autoplay/document-user-activation.html
@@ -2,6 +2,7 @@ <title>Test document user gesture autoplay policy</title> <script src='../../resources/testharness.js'></script> <script src='../../resources/testharnessreport.js'></script> +<script src='../media-file.js'></script> <body> <div id='target'>target</div> </body> @@ -14,7 +15,7 @@ window.internals.settings.setAutoplayPolicy('document-user-activation-required'); var video = document.createElement('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); return promise_rejects(t, 'NotAllowedError', video.play()); }, 'Not allowed to autoplay without some sort of user gesture'); @@ -28,7 +29,7 @@ eventSender.keyDown('a'); var video = document.createElement('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); return video.play(); }, 'Allowed to autoplay if the document received a key event'); @@ -50,7 +51,7 @@ }]); var video = document.createElement('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); return video.play(); }, 'Allowed to autoplay if the document received a click'); @@ -78,7 +79,7 @@ }]); var video = document.createElement('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); return video.play(); }, 'Allowed to autoplay if the document received a tap'); @@ -108,7 +109,7 @@ var video = document.implementation.createHTMLDocument().createElement('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); document.body.appendChild(video); // Moved to `window.document`. document.body.removeChild(video); // To avoid polluting the DOM. return video.play(); @@ -137,7 +138,7 @@ }]); var video = document.createElement('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.play().then(resolve, reject); });
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/addtrack.html b/third_party/WebKit/LayoutTests/media/avtrack/addtrack.html index 1c97501..f8e8e078 100644 --- a/third_party/WebKit/LayoutTests/media/avtrack/addtrack.html +++ b/third_party/WebKit/LayoutTests/media/avtrack/addtrack.html
@@ -4,7 +4,8 @@ <title>AudioTrackList & VideoTrackList addtrack event</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> - </head> + <script src="../media-file.js"></script> + </head> <body> <script> function addtrack_test(tagName, src, label) @@ -53,10 +54,10 @@ }, tagName + " : " + label); } - addtrack_test("audio", "../content/test.oga", "audio-only"); - addtrack_test("audio", "../content/test.ogv", "audio-video"); - addtrack_test("video", "../content/test.oga", "audio-only"); - addtrack_test("video", "../content/test.ogv", "audio-video"); + addtrack_test("audio", findMediaFile("audio", "../content/test"), "audio-only"); + addtrack_test("audio", findMediaFile("video", "../content/test"), "audio-video"); + addtrack_test("video", findMediaFile("audio", "../content/test"), "audio-only"); + addtrack_test("video", findMediaFile("video", "../content/test"), "audio-video"); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/audio-track-enabled.html b/third_party/WebKit/LayoutTests/media/avtrack/audio-track-enabled.html index 664bbaa..6244af4 100644 --- a/third_party/WebKit/LayoutTests/media/avtrack/audio-track-enabled.html +++ b/third_party/WebKit/LayoutTests/media/avtrack/audio-track-enabled.html
@@ -4,13 +4,14 @@ <title>AudioTrack.enabled change</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> - </head> + <script src="../media-file.js"></script> + </head> <body> <script> async_test(function(t) { var audio = document.createElement("audio"); - audio.src = "../content/test.oga"; + audio.src = findMediaFile("audio", "../content/test"); audio.onloadedmetadata = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/audio-track-properties.html b/third_party/WebKit/LayoutTests/media/avtrack/audio-track-properties.html index c9aa26a..909849b 100644 --- a/third_party/WebKit/LayoutTests/media/avtrack/audio-track-properties.html +++ b/third_party/WebKit/LayoutTests/media/avtrack/audio-track-properties.html
@@ -4,7 +4,8 @@ <title>AudioTrack properties read from input stream metadata</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> - </head> + <script src="../media-file.js"></script> + </head> <body> <script> async_test(function(t)
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/forget-on-load.html b/third_party/WebKit/LayoutTests/media/avtrack/forget-on-load.html index b902566a..700a472c 100644 --- a/third_party/WebKit/LayoutTests/media/avtrack/forget-on-load.html +++ b/third_party/WebKit/LayoutTests/media/avtrack/forget-on-load.html
@@ -4,13 +4,14 @@ <title>AudioTrackList & VideoTrackList after load()</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> - </head> + <script src="../media-file.js"></script> + </head> <body> <script> async_test(function(t) { var video = document.createElement("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.addEventListener("loadedmetadata", t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/gc.html b/third_party/WebKit/LayoutTests/media/avtrack/gc.html index e31b4e57..154773c 100644 --- a/third_party/WebKit/LayoutTests/media/avtrack/gc.html +++ b/third_party/WebKit/LayoutTests/media/avtrack/gc.html
@@ -4,13 +4,14 @@ <title>AudioTrack & VideoTrack garbage collection</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> - </head> + <script src="../media-file.js"></script> + </head> <body> <script> async_test(function(t) { var video = document.createElement('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.addEventListener('loadedmetadata', t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/getTrackById.html b/third_party/WebKit/LayoutTests/media/avtrack/getTrackById.html index 6c59ccd5..5b52128 100644 --- a/third_party/WebKit/LayoutTests/media/avtrack/getTrackById.html +++ b/third_party/WebKit/LayoutTests/media/avtrack/getTrackById.html
@@ -4,7 +4,8 @@ <title>AudioTrackList & VideoTrackList.getTrackById</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> - </head> + <script src="../media-file.js"></script> + </head> <body> <script> async_test(function(t) @@ -17,7 +18,7 @@ assert_equals(video.videoTracks.length, 0); assert_equals(video.videoTracks.getTrackById(''), null); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.addEventListener('loadedmetadata', t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/track-switching.html b/third_party/WebKit/LayoutTests/media/avtrack/track-switching.html index bf577fd5..88f6f1a8 100644 --- a/third_party/WebKit/LayoutTests/media/avtrack/track-switching.html +++ b/third_party/WebKit/LayoutTests/media/avtrack/track-switching.html
@@ -4,7 +4,8 @@ <title>Media track switching during playback</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> - </head> + <script src="../media-file.js"></script> + </head> <body> <script> async_test(function(t)
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/video-track-properties.html b/third_party/WebKit/LayoutTests/media/avtrack/video-track-properties.html index e965134..01e45c94 100644 --- a/third_party/WebKit/LayoutTests/media/avtrack/video-track-properties.html +++ b/third_party/WebKit/LayoutTests/media/avtrack/video-track-properties.html
@@ -4,7 +4,8 @@ <title>VideoTrack properties read from input stream metadata</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> - </head> + <script src="../media-file.js"></script> + </head> <body> <script> async_test(function(t)
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/video-track-selected.html b/third_party/WebKit/LayoutTests/media/avtrack/video-track-selected.html index 9ec3c5c3..6e7ef4c 100644 --- a/third_party/WebKit/LayoutTests/media/avtrack/video-track-selected.html +++ b/third_party/WebKit/LayoutTests/media/avtrack/video-track-selected.html
@@ -4,13 +4,14 @@ <title>VideoTrack.selected change</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> - </head> + <script src="../media-file.js"></script> + </head> <body> <script> async_test(function(t) { var video = document.createElement("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.onloadedmetadata = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/broken-video.html b/third_party/WebKit/LayoutTests/media/broken-video.html index 638b9b0b..3c477ef 100644 --- a/third_party/WebKit/LayoutTests/media/broken-video.html +++ b/third_party/WebKit/LayoutTests/media/broken-video.html
@@ -1,12 +1,13 @@ <!DOCTYPE HTML> <title>Test that an invalid video file generates a MEDIA_ERR_SRC_NOT_SUPPORTED error and sets networkState to NETWORK_NO_SOURCE.</title> +<script src="media-file.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/garbage.ogv"; + video.src = findMediaFile("video", "content/garbage"); video.onerror = t.step_func_done(function () { assert_true(video.error instanceof MediaError); assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
diff --git a/third_party/WebKit/LayoutTests/media/color-profile-video-seek-filter.html b/third_party/WebKit/LayoutTests/media/color-profile-video-seek-filter.html index 806fb957..8267d19 100644 --- a/third_party/WebKit/LayoutTests/media/color-profile-video-seek-filter.html +++ b/third_party/WebKit/LayoutTests/media/color-profile-video-seek-filter.html
@@ -38,7 +38,7 @@ video.pause(); }, false); - setSrcByTagName('video', 'content/test.ogv'); + setSrcByTagName('video', findMediaFile('video', 'content/test')); seek(video, 1.0); };
diff --git a/third_party/WebKit/LayoutTests/media/color-profile-video-seek-object-fit.html b/third_party/WebKit/LayoutTests/media/color-profile-video-seek-object-fit.html index 57f98b9..c32de0c 100644 --- a/third_party/WebKit/LayoutTests/media/color-profile-video-seek-object-fit.html +++ b/third_party/WebKit/LayoutTests/media/color-profile-video-seek-object-fit.html
@@ -37,7 +37,7 @@ video.pause(); }, false); - setSrcByTagName('video', 'content/test.ogv'); + setSrcByTagName('video', findMediaFile('video', 'content/test')); seek(video, 3.8); };
diff --git a/third_party/WebKit/LayoutTests/media/color-profile-video-seek.html b/third_party/WebKit/LayoutTests/media/color-profile-video-seek.html index f97fb38..f22af0e 100644 --- a/third_party/WebKit/LayoutTests/media/color-profile-video-seek.html +++ b/third_party/WebKit/LayoutTests/media/color-profile-video-seek.html
@@ -32,7 +32,7 @@ video.pause(); }, false); - setSrcByTagName('video', 'content/test.ogv'); + setSrcByTagName('video', findMediaFile('video', 'content/test')); seek(video, 3.8); };
diff --git a/third_party/WebKit/LayoutTests/media/color-profile-video.html b/third_party/WebKit/LayoutTests/media/color-profile-video.html index dcc2a780..d3d1ab2 100644 --- a/third_party/WebKit/LayoutTests/media/color-profile-video.html +++ b/third_party/WebKit/LayoutTests/media/color-profile-video.html
@@ -35,7 +35,7 @@ }; } - setSrcByTagName('video', 'content/test.ogv'); + setSrcByTagName('video', findMediaFile('video', 'content/test')); }; </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/content/test-par-16-9.mp4 b/third_party/WebKit/LayoutTests/media/content/test-par-16-9.mp4 new file mode 100644 index 0000000..a0223dc00 --- /dev/null +++ b/third_party/WebKit/LayoutTests/media/content/test-par-16-9.mp4 Binary files differ
diff --git a/third_party/WebKit/LayoutTests/media/content/test_yuv420.mp4 b/third_party/WebKit/LayoutTests/media/content/test_yuv420.mp4 new file mode 100644 index 0000000..86ce14e --- /dev/null +++ b/third_party/WebKit/LayoutTests/media/content/test_yuv420.mp4 Binary files differ
diff --git a/third_party/WebKit/LayoutTests/media/content/test_yuv422.mp4 b/third_party/WebKit/LayoutTests/media/content/test_yuv422.mp4 new file mode 100644 index 0000000..f211e0a --- /dev/null +++ b/third_party/WebKit/LayoutTests/media/content/test_yuv422.mp4 Binary files differ
diff --git a/third_party/WebKit/LayoutTests/media/controls-after-reload.html b/third_party/WebKit/LayoutTests/media/controls-after-reload.html index 453573ab..172306f 100644 --- a/third_party/WebKit/LayoutTests/media/controls-after-reload.html +++ b/third_party/WebKit/LayoutTests/media/controls-after-reload.html
@@ -29,7 +29,7 @@ { video.removeEventListener("canplaythrough", canplaythrough); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.addEventListener("playing", playing); video.play(); } @@ -38,8 +38,8 @@ { video = document.getElementsByTagName('video')[0]; video.addEventListener("canplaythrough", canplaythrough); - - video.src = "content/counting.ogv"; + + video.src = findMediaFile("video", "content/counting"); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/media/controls-css-overload.html b/third_party/WebKit/LayoutTests/media/controls-css-overload.html index 557efe5..2a9f63c0 100644 --- a/third_party/WebKit/LayoutTests/media/controls-css-overload.html +++ b/third_party/WebKit/LayoutTests/media/controls-css-overload.html
@@ -2,6 +2,7 @@ <title>Testing that overloading some controls doesn't crash the browser</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <style> .nocontrols::-webkit-media-controls-panel { display:none;
diff --git a/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering-expected-mismatch.html b/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering-expected-mismatch.html index e942443..85a48b4 100644 --- a/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering-expected-mismatch.html +++ b/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering-expected-mismatch.html
@@ -12,7 +12,7 @@ testRunner.waitUntilDone(); var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.addEventListener("loadeddata", function() { if (window.eventSender) {
diff --git a/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering.html b/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering.html index 9c53639..135ff577 100644 --- a/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering.html +++ b/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering.html
@@ -12,7 +12,7 @@ testRunner.waitUntilDone(); var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.addEventListener("loadeddata", function() { video.play();
diff --git a/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html b/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html index 91882047..33ca8a60 100644 --- a/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html +++ b/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html
@@ -2,6 +2,7 @@ <title>Test that dragging the timebar thumb causes seeks.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls></video> <script> @@ -13,7 +14,7 @@ var video = document.querySelector("video"); video.onplaying = t.step_func(playing); video.onseeked = t.step_func(seeked); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.play(); function playing() {
diff --git a/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html b/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html index 8116ffa..a4ac8c22 100644 --- a/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html +++ b/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html
@@ -13,7 +13,7 @@ testRunner.waitUntilDone(); function test() { - var src = "content/empty.oga"; + var src = findMediaFile("audio", "content/empty"); document.getElementById("audio1").src = src; runAfterLayoutAndPaint(function() {
diff --git a/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html b/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html index 2eb4bf2..39cd50f 100644 --- a/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html +++ b/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html
@@ -2,6 +2,7 @@ <title>Test that right clicking on the timebar does not cause a seek.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls></video> <script> @@ -15,7 +16,7 @@ video.onseeked = t.unreached_func(); video.autoplay = true; - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); function click() { var seekCoords = mediaControlsButtonCoordinates(video, "timeline");
diff --git a/third_party/WebKit/LayoutTests/media/controls-strict.html b/third_party/WebKit/LayoutTests/media/controls-strict.html index 4ab66b6..de5b4de 100644 --- a/third_party/WebKit/LayoutTests/media/controls-strict.html +++ b/third_party/WebKit/LayoutTests/media/controls-strict.html
@@ -4,7 +4,7 @@ <script src="media-file.js"></script> <script src="video-paint-test.js"></script> </head> - <body onload="setSrcByTagName('video', 'content/test.ogv'); init()"> + <body onload="setSrcByTagName('video', findMediaFile('video', 'content/test')); init()"> <p>Drawing the controls in strict mode.</p> <video controls></video> </body>
diff --git a/third_party/WebKit/LayoutTests/media/controls-styling-strict.html b/third_party/WebKit/LayoutTests/media/controls-styling-strict.html index 03a1bf06..ecc188d 100644 --- a/third_party/WebKit/LayoutTests/media/controls-styling-strict.html +++ b/third_party/WebKit/LayoutTests/media/controls-styling-strict.html
@@ -10,7 +10,7 @@ } </style> </head> - <body onload="setSrcByTagName('video', 'content/test.ogv'); init();"> + <body onload="setSrcByTagName('video', findMediaFile('video', 'content/test')); init();"> <p>The look of the controls should not change when styled under strict mode.</p> <video controls></video> <video controls></video>
diff --git a/third_party/WebKit/LayoutTests/media/controls-styling.html b/third_party/WebKit/LayoutTests/media/controls-styling.html index 6dd98ab2..453ae46 100644 --- a/third_party/WebKit/LayoutTests/media/controls-styling.html +++ b/third_party/WebKit/LayoutTests/media/controls-styling.html
@@ -15,7 +15,7 @@ } </style> </head> -<body onload="setSrcByTagName('video', 'content/test.ogv'); init()"> +<body onload="setSrcByTagName('video', findMediaFile('video', 'content/test')); init()"> <p>The look of the controls should not change.</p> <div class="override"> <video controls></video>
diff --git a/third_party/WebKit/LayoutTests/media/controls-timeline.html b/third_party/WebKit/LayoutTests/media/controls-timeline.html index 2556b649..85bdc617 100644 --- a/third_party/WebKit/LayoutTests/media/controls-timeline.html +++ b/third_party/WebKit/LayoutTests/media/controls-timeline.html
@@ -2,12 +2,13 @@ <title>Test seeking on the media controls timeline</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.onloadedmetadata = t.step_func_done(function() { assert_equals(video.currentTime, 0);
diff --git a/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html b/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html index cd91b0c..187b9f0c 100644 --- a/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html +++ b/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html
@@ -2,12 +2,13 @@ <title>Test media controls volume slider keyboard navigation</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <audio controls></audio> <script> async_test(function(t) { var audio = document.querySelector("audio"); - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); assert_equals(audio.volume, 1); audio.onloadedmetadata = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/controls-volume-slider.html b/third_party/WebKit/LayoutTests/media/controls-volume-slider.html index aa88176..8b2f9408 100644 --- a/third_party/WebKit/LayoutTests/media/controls-volume-slider.html +++ b/third_party/WebKit/LayoutTests/media/controls-volume-slider.html
@@ -2,12 +2,13 @@ <title>media controls volume slider</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <audio controls></audio> <script> async_test(function(t) { var audio = document.querySelector("audio"); - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); assert_equals(audio.volume, 1); audio.onloadedmetadata = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/controls-without-preload.html b/third_party/WebKit/LayoutTests/media/controls-without-preload.html index d5265ae..f90ffa6 100644 --- a/third_party/WebKit/LayoutTests/media/controls-without-preload.html +++ b/third_party/WebKit/LayoutTests/media/controls-without-preload.html
@@ -9,7 +9,7 @@ function start() { - setSrcByTagName("video", "content/test.ogv"); + setSrcByTagName("video", findMediaFile("video", "content/test")); video = document.getElementsByTagName('video')[0]; video.load(); video.play();
diff --git a/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset-expected.html b/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset-expected.html index cfe386e4..a5925bb 100644 --- a/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset-expected.html +++ b/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset-expected.html
@@ -1,11 +1,12 @@ <!DOCTYPE html> <html> +<script src="../media-file.js"></script> <video controls width=400> <track kind=subtitles src=fake-en-sub.vtt srclang=en label=English> <track kind=subtitles src=fake-fr-sub.vtt srclang=fr label=French> </video> <script> var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset.html b/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset.html index bc27d11..a08cd65 100644 --- a/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset.html +++ b/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <html> <title>Test that resetting the controls after load is a no-op.</title> +<script src="../media-file.js"></script> <video controls width=400> <track kind=subtitles src=fake-en-sub.vtt srclang=en label=English> <track kind=subtitles src=fake-fr-sub.vtt srclang=fr label=French> @@ -10,7 +11,7 @@ testRunner.waitUntilDone(); var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.addEventListener('loadedmetadata', () => { video.controls = false; testRunner.layoutAndPaintAsyncThen(() => {
diff --git a/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible-expected.html b/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible-expected.html index be96cc9..b625f0e 100644 --- a/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible-expected.html +++ b/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible-expected.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Captions menu always visible - expected</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <style> video { @@ -14,7 +15,7 @@ testRunner.waitUntilDone(); var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.addTextTrack('captions', 'foo'); video.addTextTrack('captions', 'bar');
diff --git a/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible.html b/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible.html index 24d9ab2..69df936 100644 --- a/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible.html +++ b/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Captions menu always visible</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <style> .container { @@ -17,7 +18,7 @@ testRunner.waitUntilDone(); var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.addTextTrack('captions', 'foo'); video.addTextTrack('captions', 'bar');
diff --git a/third_party/WebKit/LayoutTests/media/controls/closed-captions-dynamic-update.html b/third_party/WebKit/LayoutTests/media/controls/closed-captions-dynamic-update.html index d4c10baa..dc9d80d2 100644 --- a/third_party/WebKit/LayoutTests/media/controls/closed-captions-dynamic-update.html +++ b/third_party/WebKit/LayoutTests/media/controls/closed-captions-dynamic-update.html
@@ -2,6 +2,7 @@ <title>Tests that the closed captions button enables track switching.</title> <script src='../../resources/testharness.js'></script> <script src='../../resources/testharnessreport.js'></script> +<script src='../media-file.js'></script> <script src='../media-controls.js'></script> <video controls> <track src='../track/captions-webvtt/captions-fast.vtt' kind='captions'> @@ -66,6 +67,6 @@ clickTextTrackAtIndex(video, 0); }); - video.src = '../content/counting.ogv'; + video.src = findMediaFile('video', '../content/counting'); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/closed-captions-on-off.html b/third_party/WebKit/LayoutTests/media/controls/closed-captions-on-off.html index c9d72bb..8558d03 100644 --- a/third_party/WebKit/LayoutTests/media/controls/closed-captions-on-off.html +++ b/third_party/WebKit/LayoutTests/media/controls/closed-captions-on-off.html
@@ -3,6 +3,7 @@ <script src='../../resources/testharness.js'></script> <script src='../../resources/testharnessreport.js'></script> <script src='../media-controls.js'></script> +<script src='../media-file.js'></script> <video controls></video> <script> async_test(t => { @@ -44,6 +45,6 @@ })); }); - video.src = '../content/counting.ogv'; + video.src = findMediaFile('video', '../content/counting'); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html b/third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html index 77ee734..554c76fb 100644 --- a/third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html +++ b/third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html
@@ -3,6 +3,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <video controls></video> <script> async_test(t => { @@ -47,6 +48,6 @@ })); }); - video.src = "../content/counting.ogv"; + video.src = findMediaFile("video", "../content/counting"); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/closed-captions-switch-track.html b/third_party/WebKit/LayoutTests/media/controls/closed-captions-switch-track.html index b46f7b45..2915e3f3 100644 --- a/third_party/WebKit/LayoutTests/media/controls/closed-captions-switch-track.html +++ b/third_party/WebKit/LayoutTests/media/controls/closed-captions-switch-track.html
@@ -2,6 +2,7 @@ <title>Test that we can add multiple tracks and select between them from the track selection menu.</title> <script src='../../resources/testharness.js'></script> <script src='../../resources/testharnessreport.js'></script> +<script src='../media-file.js'></script> <script src='../media-controls.js'></script> <!-- Width should be large enough to display closed captions button. --> <video controls style='width: 500px'></video> @@ -37,6 +38,6 @@ })); }); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-low-end-device.html b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-low-end-device.html index 889fc4d..a21dd2ba 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-low-end-device.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-low-end-device.html
@@ -2,6 +2,7 @@ <title>media controls cast button low end device</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../remoteplayback/util.js"></script> <video width="500"></video> @@ -22,6 +23,6 @@ assert_true(isVisible(castButton(video))); }); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-narrow.html b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-narrow.html index 4caab982..34cd5310 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-narrow.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-narrow.html
@@ -2,12 +2,13 @@ <title>media controls cast button</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video width="100" height="200" controls></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.onloadedmetadata = t.step_func(function() { // Pretend we have a cast device
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button.html b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button.html index 2d74dd26..e3c8a1c 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button.html
@@ -2,12 +2,13 @@ <title>media controls cast button</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video controls width="500"></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.onloadedmetadata = t.step_func_done(function() { // Should not have a cast button by default
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-cast-do-not-fade-out.html b/third_party/WebKit/LayoutTests/media/controls/controls-cast-do-not-fade-out.html index 91da5e2..ffdcd72 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-cast-do-not-fade-out.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-cast-do-not-fade-out.html
@@ -2,12 +2,13 @@ <title>This tests that controls do not fade out when the video is playing remotely.</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video controls loop></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.onplaying = t.step_func(function() { internals.mediaPlayerPlayingRemotelyChanged(video, true);
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html b/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html index bf596d1..0b065a0 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html
@@ -2,6 +2,7 @@ <title>Test that the overlay cast button fades at the right time (neither too soon nor too late).</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video loop></video> <script> @@ -11,7 +12,7 @@ var hideTimeoutLowerBound = controlsMouseMovementTimeoutMs - 500; var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.onplaying = t.step_func(function() { setTimeout(t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button-autoplay-muted.html b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button-autoplay-muted.html index eb69dea..b3be3ac 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button-autoplay-muted.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button-autoplay-muted.html
@@ -2,6 +2,7 @@ <title>media controls overlay cast button for autoplay muted element</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <body></body> <script> @@ -19,7 +20,7 @@ var video = document.createElement("video"); video.muted = true; video.autoplay = true; - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.onloadedmetadata = t.step_func_done(function() { // Pretend we have a cast device
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html index dbc8311..92b09e0 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html
@@ -2,12 +2,13 @@ <title>media controls cast button</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.onloadedmetadata = t.step_func_done(function() { // Should not have a cast button by default
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-in.html b/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-in.html index 8680352..d9d2031 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-in.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-in.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <html> <title>Test that media controls are painted corrected when using page zoom.</title> +<script src="../media-file.js"></script> <video controls width="400"></video> <script> var video = document.querySelector('video'); @@ -22,7 +23,7 @@ testRunner.notifyDone(); }; - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.play(); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-out.html b/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-out.html index 3adbd69..0c81325 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-out.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-out.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <html> <title>Test that media controls are painted corrected when using page zoom.</title> +<script src="../media-file.js"></script> <video controls width="400"></video> <script> var video = document.querySelector('video'); @@ -22,7 +23,7 @@ testRunner.notifyDone(); }; - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.play(); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-no-controls.html b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-no-controls.html index 70404f1..fe078711 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-no-controls.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-no-controls.html
@@ -2,6 +2,7 @@ <title>Test media controls video keyboard navigation</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video></video> <script> @@ -11,7 +12,7 @@ async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); assert_equals(video.volume, 1); assert_equals(video.currentTime, 0);
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-space-vol.html b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-space-vol.html index 17bdadf..f958d3c 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-space-vol.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-space-vol.html
@@ -2,6 +2,7 @@ <title>Test media controls video keyboard navigation for volume and space bar</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video controls></video> <script> @@ -11,7 +12,7 @@ async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); assert_equals(video.volume, 1); assert_equals(video.currentTime, 0);
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav.html b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav.html index 6e6a9e1..f93eee4 100644 --- a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav.html +++ b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav.html
@@ -2,6 +2,7 @@ <title>Test media controls video keyboard navigation</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video controls></video> <script> @@ -11,7 +12,7 @@ async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); assert_equals(video.volume, 1); assert_equals(video.currentTime, 0);
diff --git a/third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html b/third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html index 85d9ce6a..89aaad2 100644 --- a/third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html +++ b/third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html
@@ -2,6 +2,7 @@ <title>media controls download button preload none</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video controls preload="none" src="https://someexample.example/example.mp4"></video> <script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/lazy-loaded-style.html b/third_party/WebKit/LayoutTests/media/controls/lazy-loaded-style.html index e3839ef3..cde9cf71 100644 --- a/third_party/WebKit/LayoutTests/media/controls/lazy-loaded-style.html +++ b/third_party/WebKit/LayoutTests/media/controls/lazy-loaded-style.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <html> <title>Test that media controls are styled correctly if lazy loaded.</title> +<script src="../media-file.js"></script> <video width="400"></video> <script> var video = document.querySelector('video'); @@ -15,7 +16,7 @@ testRunner.notifyDone(); }; - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.play(); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/overflow-fully-hidden.html b/third_party/WebKit/LayoutTests/media/controls/overflow-fully-hidden.html index 6c3ba5b..454a7bd 100644 --- a/third_party/WebKit/LayoutTests/media/controls/overflow-fully-hidden.html +++ b/third_party/WebKit/LayoutTests/media/controls/overflow-fully-hidden.html
@@ -9,6 +9,7 @@ <meta name='viewport' content='width=800'> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> </head> <style> @@ -26,7 +27,7 @@ test(_ => { var videos = document.querySelectorAll('video'); for (var video, i = 0; video = videos[i]; ++i) { - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); } var forceLayout = document.body.offsetHeight;
diff --git a/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible-expected.html b/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible-expected.html index b06e48a..27958cc 100644 --- a/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible-expected.html +++ b/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible-expected.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Overflow menu always visible - expected</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <style> video { @@ -14,7 +15,7 @@ testRunner.waitUntilDone(); var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.addTextTrack('captions', 'foo'); video.addTextTrack('captions', 'bar');
diff --git a/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible.html b/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible.html index 2dad67e..317789a 100644 --- a/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible.html +++ b/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Overflow menu always visible</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <style> .container { @@ -17,7 +18,7 @@ testRunner.waitUntilDone(); var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.addTextTrack('captions', 'foo'); video.addTextTrack('captions', 'bar');
diff --git a/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-document-move.html b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-document-move.html index cacba37..955b89c 100644 --- a/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-document-move.html +++ b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-document-move.html
@@ -2,6 +2,7 @@ <title>media controls overlay play button document move</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="overlay-play-button.js"></script> <body> @@ -45,7 +46,7 @@ function createAndMoveVideo() { var doc = document.implementation.createHTMLDocument(); var v = doc.createElement('video'); - v.src = '../content/test.ogv'; + v.src = findMediaFile('video', '../content/test'); v.width = NORMAL_VIDEO_WIDTH; v.height = NORMAL_VIDEO_HEIGHT; v.controls = true;
diff --git a/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html index 248a6a4..77e37c4a 100644 --- a/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html +++ b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html
@@ -2,6 +2,7 @@ <title>media controls overlay play button narrow</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="overlay-play-button.js"></script> <body> @@ -12,7 +13,7 @@ enableOverlayPlayButtonForTest(t); var video = document.createElement('video'); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.width = NORMAL_VIDEO_WIDTH; video.height = NORMAL_VIDEO_HEIGHT; video.controls = true;
diff --git a/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none-custom-bg.html b/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none-custom-bg.html index 470ca1b..91fb833 100644 --- a/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none-custom-bg.html +++ b/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none-custom-bg.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <html> <title>Test that player controls are painted correctly with -webkit-appearance: none; and a custom background.</title> +<script src="../media-file.js"></script> <style> video::-webkit-media-controls-play-button { -webkit-appearance: none; @@ -10,6 +11,6 @@ <video controls width=400></video> <script> var video = document.querySelector('video'); - video.src = "../content/counting.ogv"; + video.src = findMediaFile("video", "../content/counting"); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none.html b/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none.html index 9cfb85a..6772d54b 100644 --- a/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none.html +++ b/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <html> <title>Test that player controls are painted correctly with -webkit-appearance: none;</title> +<script src="../media-file.js"></script> <style> video::-webkit-media-controls-play-button { -webkit-appearance: none; @@ -9,6 +10,6 @@ <video controls width=400></video> <script> var video = document.querySelector('video'); - video.src = "../content/counting.ogv"; + video.src = findMediaFile("video", "../content/counting"); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize-expected.html b/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize-expected.html index 9e802941..4abf143574 100644 --- a/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize-expected.html +++ b/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize-expected.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that the controls repaint correctly on resize.</title> +<script src="../media-file.js"></script> <video controls width=300></video> <script> var video = document.querySelector("video"); @@ -14,5 +15,5 @@ testRunner.notifyDone(); }; -video.src = "../content/test.ogv"; +video.src = findMediaFile("video", "../content/test"); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize.html b/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize.html index 89ee113..42abd59 100644 --- a/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize.html +++ b/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that the controls repaint correctly on resize.</title> +<script src="../media-file.js"></script> <video controls width=200></video> <script> var video = document.querySelector("video"); @@ -15,5 +16,5 @@ testRunner.notifyDone(); }; -video.src = "../content/test.ogv"; +video.src = findMediaFile("video", "../content/test"); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/rotated-video-has-right-panel-width.html b/third_party/WebKit/LayoutTests/media/controls/rotated-video-has-right-panel-width.html index 53ee59c..dc67bf1 100644 --- a/third_party/WebKit/LayoutTests/media/controls/rotated-video-has-right-panel-width.html +++ b/third_party/WebKit/LayoutTests/media/controls/rotated-video-has-right-panel-width.html
@@ -9,6 +9,7 @@ <meta name='viewport' content='width=800'> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> </head> <style> @@ -34,7 +35,7 @@ var videos = document.querySelectorAll('video'); for (var i=0; i < videos.length; ++i) { - videos[i].src = 'content/test.ogv'; + videos[i].src = findMediaFile('video', 'content/test'); } var forceLayout = document.body.offsetHeight;
diff --git a/third_party/WebKit/LayoutTests/media/controls/settings-disable-controls.html b/third_party/WebKit/LayoutTests/media/controls/settings-disable-controls.html index d753eb1..2aac53bc 100644 --- a/third_party/WebKit/LayoutTests/media/controls/settings-disable-controls.html +++ b/third_party/WebKit/LayoutTests/media/controls/settings-disable-controls.html
@@ -2,6 +2,7 @@ <title>Test that 'mediaControlsEnabled' properly toggles the native controls</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video controls></video> <script> @@ -35,6 +36,6 @@ })); })); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html b/third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html index 5e6e5607..f1ec7d33 100644 --- a/third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html +++ b/third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html
@@ -1,13 +1,14 @@ <!DOCTYPE html> <html> <title>This tests that the controls' current time is updated after media is unloaded</title> +<script src='../media-file.js'></script> <video controls></video> <script> if (window.testRunner) testRunner.waitUntilDone(); var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); // Get the video into a playing state at currentTime > 0. video.autoplay = true;
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-frame.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-frame.html index daa8dec..535d211 100644 --- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-frame.html +++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-frame.html
@@ -4,6 +4,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <video controls width=400 preload=auto></video> <script> async_test(t => { @@ -15,7 +16,7 @@ checkControlsClassName(video, 'phase-ready state-stopped'); }); - video.src = '../content/counting.ogv'; + video.src = findMediaFile('video', '../content/counting'); }); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-image.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-image.html index a9bba34..a9cee03 100644 --- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-image.html +++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-image.html
@@ -4,6 +4,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <video controls width=400 preload=auto poster="../content/greenbox.png"></video> <script> async_test(t => { @@ -15,7 +16,7 @@ checkControlsClassName(video, 'phase-ready state-stopped'); }); - video.src = '../content/counting.ogv'; + video.src = findMediaFile('video', '../content/counting'); }); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-cast.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-cast.html index ac71d8ab..ee37a61 100644 --- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-cast.html +++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-cast.html
@@ -4,6 +4,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <video controls width=400></video> <script> async_test(t => { @@ -19,7 +20,7 @@ checkButtonHasClass(castButton(video), 'on'); }); - video.src = "../content/counting.ogv"; + video.src = findMediaFile("video", "../content/counting"); video.play(); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-fullscreen.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-fullscreen.html index b421e6b..ea43064 100644 --- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-fullscreen.html +++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-fullscreen.html
@@ -4,6 +4,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <video controls width=400></video> <script> async_test(t => { @@ -22,7 +23,7 @@ clickAtCoordinates(1, 1); }); - video.src = "../content/counting.ogv"; + video.src = findMediaFile("video", "../content/counting"); video.play(); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-mute.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-mute.html index cc31a91..368e445 100644 --- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-mute.html +++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-mute.html
@@ -4,6 +4,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <video controls width=400></video> <script> async_test(t => {
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-overlay-cast.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-overlay-cast.html index 14b76a4b..4cebf33 100644 --- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-overlay-cast.html +++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-overlay-cast.html
@@ -4,6 +4,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <video controls width=400></video> <script> async_test(t => { @@ -19,7 +20,7 @@ checkButtonHasClass(overlayCastButton(video), 'on'); }); - video.src = "../content/counting.ogv"; + video.src = findMediaFile("video", "../content/counting"); video.play(); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-pause.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-pause.html index b288801..903f2ab 100644 --- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-pause.html +++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-pause.html
@@ -4,6 +4,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <video controls width=400></video> <script> async_test(t => { @@ -14,7 +15,7 @@ video.pause(); }); - video.src = "../content/counting.ogv"; + video.src = findMediaFile("video", "../content/counting"); video.play().catch(t.step_func_done(_ => { checkButtonHasClass(playButton(video), 'pause'); }));
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-error.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-error.html index 578001e..f92347d8 100644 --- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-error.html +++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-error.html
@@ -4,6 +4,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <video controls width=400></video> <script> async_test(t => { @@ -14,7 +15,7 @@ checkControlsClassName(video, "phase-pre-ready state-no-source use-default-poster"); }); - video.src = "../content/missing.ogv"; + video.src = findMediaFile("video", "../content/missing"); // Catch the error promise. video.play().catch(() => {}); });
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-reset.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-reset.html index f43fa5a..30020bd 100644 --- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-reset.html +++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-reset.html
@@ -4,6 +4,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <video controls width=400></video> <script> async_test(t => { @@ -24,11 +25,11 @@ video.onpause = t.step_func(() => { checkControlsClassName(video, "phase-ready state-stopped"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.play(); }); - video.src = "../content/counting.ogv"; + video.src = findMediaFile("video", "../content/counting"); video.play(); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-without-poster.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-without-poster.html index 4367906..5c3e123 100644 --- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-without-poster.html +++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-without-poster.html
@@ -4,6 +4,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <video controls width=400 preload=metadata></video> <script> async_test(t => { @@ -16,7 +17,7 @@ checkControlsClassName(video, 'phase-ready state-stopped use-default-poster'); }); - video.src = '../content/counting.ogv'; + video.src = findMediaFile('video', '../content/counting'); }); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-appears-when-expected.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-appears-when-expected.html index d377026..23bae03 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-appears-when-expected.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-appears-when-expected.html
@@ -3,6 +3,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <script src="../overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); // At this width, the mute and cast button don't fit. Since we have // two elements that don't fit, the overflow menu should be visible. video.setAttribute("width", "240");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-outside.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-outside.html index b0639f1..9e4c3c5 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-outside.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-outside.html
@@ -3,6 +3,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <script src="../overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.setAttribute("width", "60"); // Add captions var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-panel.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-panel.html index af446c1e6..c0f83b12 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-panel.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-panel.html
@@ -3,6 +3,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <script src="../overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.setAttribute("width", "200"); // Add captions var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click.html index 6f3086ed..d6e5a1d 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click.html
@@ -3,6 +3,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <script src="../overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.setAttribute("width", "60"); // Add captions var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-resize.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-resize.html index 954fc4d..f892a7e 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-resize.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-resize.html
@@ -9,6 +9,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <script src="../overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -21,7 +22,7 @@ // Set up video var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.setAttribute("width", "60"); // Add captions var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-text.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-text.html index 32f3876..e629708 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-text.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-text.html
@@ -3,6 +3,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <script src="../overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); // Add captions var track = video.addTextTrack("captions"); // Pretend we have a cast device
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-visibility.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-visibility.html index 9d8b37d35..09326a9 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-visibility.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-visibility.html
@@ -3,6 +3,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../media-controls.js"></script> +<script src="../media-file.js"></script> <script src="../overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.setAttribute("width", "60"); // Add captions var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-with-cast-rendering.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-with-cast-rendering.html index dcc23b8..42233d4 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-controls-with-cast-rendering.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-with-cast-rendering.html
@@ -35,7 +35,7 @@ testRunner.notifyDone(); }); }); - setSrcByTagName('video', '../content/test.ogv'); + setSrcByTagName('video', findMediaFile('video', '../content/test')); </script> </body> </html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html b/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html index 2352914a..265039f 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html
@@ -4,6 +4,7 @@ video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video controls></video> @@ -79,6 +80,6 @@ }); }); - video.src = "../content/test-25fps.ogv"; + video.src = findMediaFile("video", "../content/test-25fps"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html b/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html index 1b89422..a00d0a28 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html
@@ -5,6 +5,7 @@ <script src="../../fullscreen/full-screen-test.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video controls></video> @@ -64,6 +65,6 @@ }); }); - video.src = "../content/test-25fps.ogv"; + video.src = findMediaFile("video", "../content/test-25fps"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-in-scrollable-iframe-has-full-panel.html b/third_party/WebKit/LayoutTests/media/controls/video-in-scrollable-iframe-has-full-panel.html index 79c124f..4536a90 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-in-scrollable-iframe-has-full-panel.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-in-scrollable-iframe-has-full-panel.html
@@ -4,6 +4,7 @@ <title>Test that overflow-x: hidden with a small viewport doesn't clip the controls when in a scrollable iframe</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> </head> <style> @@ -55,7 +56,7 @@ let videos = iframedoc.querySelectorAll('video'); for (let i=0; i < videos.length; ++i) { - videos[i].src = 'content/test.ogv'; + videos[i].src = findMediaFile('video', 'content/test'); } }
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-dark-rendering.html b/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-dark-rendering.html index 8920852..adb6744 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-dark-rendering.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-dark-rendering.html
@@ -35,7 +35,7 @@ testRunner.notifyDone(); }); }); - setSrcByTagName('video', '../content/test.ogv'); + setSrcByTagName('video', findMediaFile('video', '../content/test')); </script> </body> </html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-light-rendering.html b/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-light-rendering.html index 9a7a288..57d06bd 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-light-rendering.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-light-rendering.html
@@ -35,7 +35,7 @@ testRunner.notifyDone(); }); }); - setSrcByTagName('video', '../content/counting.ogv'); + setSrcByTagName('video', findMediaFile('video', '../content/counting')); </script> </body> </html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-overlay-play-button.html b/third_party/WebKit/LayoutTests/media/controls/video-overlay-play-button.html index a67b93d..9534c57a 100644 --- a/third_party/WebKit/LayoutTests/media/controls/video-overlay-play-button.html +++ b/third_party/WebKit/LayoutTests/media/controls/video-overlay-play-button.html
@@ -2,6 +2,7 @@ <title>Test that the overlay play button respects the controls attribute.</title> <script src='../../resources/testharness.js'></script> <script src='../../resources/testharnessreport.js'></script> +<script src='../media-file.js'></script> <script src='../media-controls.js'></script> <body> <script> @@ -48,6 +49,6 @@ assert_equals(getComputedStyle(button).display, 'flex'); })); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute-expected.html b/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute-expected.html index 1dc96a5..bbc38a8 100644 --- a/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute-expected.html +++ b/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute-expected.html
@@ -1,14 +1,15 @@ <!DOCTYPE html> <html> +<script src="../media-file.js"></script> <audio controls></audio> <video controls></video> <script> var audio = document.querySelector('audio') - audio.src = '../content/test.oga'; + audio.src = findMediaFile('audio', '../content/test'); audio.muted = true; var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.muted = true; </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute.html b/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute.html index abc11b9..157aad88 100644 --- a/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute.html +++ b/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute.html
@@ -1,13 +1,14 @@ <!DOCTYPE html> <html> <title>This tests that controls are properly updated when muted content attribute is changed.</title> +<script src="../media-file.js"></script> <audio controls muted></audio> <video controls muted></video> <script> var audio = document.querySelector('audio'); - audio.src = '../content/test.oga'; + audio.src = findMediaFile('audio', '../content/test'); var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation-expected.html b/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation-expected.html index 53df22e..2cd2991f 100644 --- a/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation-expected.html +++ b/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation-expected.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <html> +<script src="../media-file.js"></script> <div> <audio controls muted></audio> </div> @@ -15,10 +16,10 @@ <script> var audios = document.querySelectorAll('audio'); for (var i = 0; i < audios.length; ++i) - audios[i].src = '../content/test.oga'; + audios[i].src = findMediaFile('audio', '../content/test'); var videos = document.querySelectorAll('video'); for (var i = 0; i < videos.length; ++i) - videos[i].src = '../content/test.ogv'; + videos[i].src = findMediaFile('video', '../content/test'); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation.html b/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation.html index a0d9760..3a44866 100644 --- a/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation.html +++ b/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <html> <title>This tests that controls are properly updated when stopImmediatePropagation is used in event handler.</title> +<script src="../media-file.js"></script> <div> <audio></audio> </div> @@ -16,27 +17,27 @@ var audio = document.createElement('audio'); audio.onvolumechange = e => { e.stopImmediatePropagation() }; document.querySelector('#a').appendChild(audio); - audio.src = '../content/test.oga'; + audio.src = findMediaFile('audio', '../content/test'); audio.controls = true; audio.onloadedmetadata = () => { audio.muted = true; } var video = document.createElement('video'); video.onvolumechange = e => { e.stopImmediatePropagation() }; document.querySelector('#v').appendChild(video); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.controls = true; video.onloadedmetadata = () => { video.muted = true; } // Elements created during parsing. var audio = document.querySelector('audio'); audio.onvolumechange = e => { e.stopImmediatePropagation() }; - audio.src = '../content/test.oga'; + audio.src = findMediaFile('audio', '../content/test'); audio.controls = true; audio.muted = true; var video = document.querySelector('video'); video.onvolumechange = e => { e.stopImmediatePropagation() }; - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.controls = true; video.muted = true; </script>
diff --git a/third_party/WebKit/LayoutTests/media/csp-blocks-video.html b/third_party/WebKit/LayoutTests/media/csp-blocks-video.html index 2e0d3f2..edf8396 100644 --- a/third_party/WebKit/LayoutTests/media/csp-blocks-video.html +++ b/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
@@ -4,10 +4,11 @@ <video></video> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.onloadedmetadata = t.unreached_func(); video.onerror = t.step_func_done();
diff --git a/third_party/WebKit/LayoutTests/media/event-attributes.html b/third_party/WebKit/LayoutTests/media/event-attributes.html index 33a49f6..c707258 100644 --- a/third_party/WebKit/LayoutTests/media/event-attributes.html +++ b/third_party/WebKit/LayoutTests/media/event-attributes.html
@@ -2,6 +2,7 @@ <title>Test event attributes for media element.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video controls></video> <script> async_test(function(t) { @@ -60,7 +61,7 @@ video.onended = t.step_func(function(event) { actual_events.push(event.type); - video.src = "content/garbage.ogv"; + video.src = findMediaFile("video", "content/garbage"); progressEventCount = 0; }); @@ -88,6 +89,6 @@ video.onplay = defaultEventStepFunction; video.onseeking = defaultEventStepFunction; - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/fullscreen-controls-visible-last.html b/third_party/WebKit/LayoutTests/media/fullscreen-controls-visible-last.html index 085ad74..f46b8f29 100644 --- a/third_party/WebKit/LayoutTests/media/fullscreen-controls-visible-last.html +++ b/third_party/WebKit/LayoutTests/media/fullscreen-controls-visible-last.html
@@ -2,13 +2,14 @@ <title>Tests that the fullscreen button control is the antepenultimate media controls button visible.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <script src="overflow-menu.js"></script> <video controls></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); // Since this is a video, we'll have three elements visible when the width // is 120. These three should be: play, fullscreen, overflow. video.setAttribute("width", "120");
diff --git a/third_party/WebKit/LayoutTests/media/gc-pending-event.html b/third_party/WebKit/LayoutTests/media/gc-pending-event.html index f220227..6effe6a 100644 --- a/third_party/WebKit/LayoutTests/media/gc-pending-event.html +++ b/third_party/WebKit/LayoutTests/media/gc-pending-event.html
@@ -2,6 +2,7 @@ <title>Verify that a pending event prevents GC</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> async_test(function(t) {
diff --git a/third_party/WebKit/LayoutTests/media/gc-while-playing.html b/third_party/WebKit/LayoutTests/media/gc-while-playing.html index 08483e7..d34139b 100644 --- a/third_party/WebKit/LayoutTests/media/gc-while-playing.html +++ b/third_party/WebKit/LayoutTests/media/gc-while-playing.html
@@ -2,12 +2,13 @@ <title>GC while playing</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> async_test(function(t) { var a = document.createElement("audio"); a.foo = "bar"; - a.src = "content/test.oga"; + a.src = findMediaFile("audio", "content/test"); a.onsuspend = t.step_func(function() { assert_equals(a.networkState, a.NETWORK_IDLE);
diff --git a/third_party/WebKit/LayoutTests/media/gc-while-seeking.html b/third_party/WebKit/LayoutTests/media/gc-while-seeking.html index dcd665b..37add463 100644 --- a/third_party/WebKit/LayoutTests/media/gc-while-seeking.html +++ b/third_party/WebKit/LayoutTests/media/gc-while-seeking.html
@@ -2,12 +2,13 @@ <title>GC while seeking</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> async_test(function(t) { var a = document.createElement("audio"); a.foo = "bar"; - a.src = "content/test.oga"; + a.src = findMediaFile("audio", "content/test"); a.onsuspend = t.step_func(function() { assert_equals(a.networkState, a.NETWORK_IDLE);
diff --git a/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html b/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html index 14b3a8aa..d3e2858 100644 --- a/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html +++ b/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html
@@ -4,12 +4,13 @@ video { display: none; } </style> <video></video> +<script src="media-file.js"></script> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script> async_test(function(t) { var video = document.querySelector("video"); video.ondurationchange = t.step_func_done(); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-mpeg-audio.html b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg-audio.html new file mode 100644 index 0000000..cd27f000 --- /dev/null +++ b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg-audio.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<title>Test HTMLMediaElement's "canPlayType" method with multiple audio mpeg MIME types.</title> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<audio></audio> +<script> +test(function() { + var audio = document.querySelector("audio"); + // Currently no platform supports the below formats. + assert_equals(audio.canPlayType("audio/x-mpeg"), ""); + assert_equals(audio.canPlayType("audio/x-mp3"), ""); + assert_equals(audio.canPlayType("audio/mp3"), ""); + assert_equals(audio.canPlayType("audio/mpeg"), ""); + + assert_equals(audio.canPlayType("audio/mp4"), ""); + assert_equals(audio.canPlayType("audio/aac"), ""); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-mpeg4-video.html b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg4-video.html new file mode 100644 index 0000000..adb4e7a --- /dev/null +++ b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg4-video.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<title>Test HTMLMediaElement's "canPlayType" method with multiple video mpeg4 MIME types.</title> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<video></video> +<script> +test(function() { + var video = document.querySelector("video"); + // Currently no platform supports the below formats. + assert_equals(video.canPlayType("video/x-m4v"), ""); + assert_equals(video.canPlayType("video/mp4"), ""); + assert_equals(video.canPlayType("video/mp4; Codecs=\"avc1.4D400C\""), ""); + assert_equals(video.canPlayType("Video/MP4; CODECS=\"mp4v.20.8, mp4a.40.2\""), ""); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html b/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html new file mode 100644 index 0000000..8d38917 --- /dev/null +++ b/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<title>Test HTMLMediaElement's "canPlayType" method with "application/octet-stream".</title> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<script> +function check_media_element_canplaytype(elementName) { + test(function() { + var mediaElement = document.createElement(elementName); + // These tests should always pass as no platform + // should support "application/octet-stream". + assert_equals(mediaElement.canPlayType("APPLICATION/octet-stream"), ""); + assert_equals(mediaElement.canPlayType("application/octet-stream;codecs=theora"), ""); + assert_equals(mediaElement.canPlayType("application/octet-stream;codecs=mp4"), ""); + }, "check \"canPlayType\" method for " + elementName); +} + +check_media_element_canplaytype("audio"); +check_media_element_canplaytype("video"); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html b/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html new file mode 100644 index 0000000..487f189 --- /dev/null +++ b/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<title>Test HTMLMediaElement's "canPlayType" method for ogg media containers.</title> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<video></video> +<script> +test(function() { + var video = document.querySelector('video'); + // These tests may be expected to fail if the platform does not support the format. + assert_equals(video.canPlayType('audio/ogg'), 'maybe'); + assert_equals(video.canPlayType('video/ogg'), 'maybe'); + + assert_equals(video.canPlayType('audio/ogg; codecs=vorbis'), 'probably'); + assert_equals(video.canPlayType('audio/ogg; codecs=opus'), 'probably'); + assert_equals(video.canPlayType('video/ogg; codecs=theora'), 'probably'); + assert_equals(video.canPlayType('video/ogg; codecs="theora,vorbis"'), 'probably'); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-type.html b/third_party/WebKit/LayoutTests/media/media-can-play-type.html new file mode 100644 index 0000000..237ed18 --- /dev/null +++ b/third_party/WebKit/LayoutTests/media/media-can-play-type.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> +<title>Test HTMLMediaElement's "canPlayType" method with invalid MIME types.</title> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<video></video> +<script> +test(function() { + var video = document.querySelector("video"); + + assert_throws(new TypeError, function() { video.canPlayType(); }); + assert_equals(video.canPlayType("video/"), ""); + assert_equals(video.canPlayType("video/blahblah"), ""); + assert_equals(video.canPlayType("video/blahblah; codecs=\"blah, , blah\""), ""); + assert_equals(video.canPlayType("video/blahblah; codecs=blah"), ""); + assert_equals(video.canPlayType("video/blahblah; codecs=\"blah\""), ""); + assert_equals(video.canPlayType("video/blahblah; codecs=\"badcontent"), ""); + assert_equals(video.canPlayType("video/blahblah; codecs=badcontent\""), ""); + assert_equals(video.canPlayType("video/blahblah; codecs="badcontent""), ""); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-wav-audio.html b/third_party/WebKit/LayoutTests/media/media-can-play-wav-audio.html new file mode 100644 index 0000000..70f9422 --- /dev/null +++ b/third_party/WebKit/LayoutTests/media/media-can-play-wav-audio.html
@@ -0,0 +1,17 @@ +<!DOCTYPE html> +<title>Test HTMLMediaElement's "canPlayType" method with multiple .wav MIME types.</title> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<audio></audio> +<script> +test(function() { + var audio = document.querySelector("audio"); + // These tests may be expected to fail if the platform does not support the format. + assert_equals(audio.canPlayType("audio/wav"), "maybe"); + assert_equals(audio.canPlayType("audio/x-wav"), "maybe"); + + // WAV codec 1 is basic PCM, refer to http://tools.ietf.org/html/rfc2361 + assert_equals(audio.canPlayType("audio/wav; codecs=1"), "probably"); + assert_equals(audio.canPlayType("audio/x-wav; codecs=1"), "probably"); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-webm.html b/third_party/WebKit/LayoutTests/media/media-can-play-webm.html new file mode 100644 index 0000000..9e8531a9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/media/media-can-play-webm.html
@@ -0,0 +1,32 @@ +<!DOCTYPE html> +<title>Test HTMLMediaElement's "canPlayType" method for webm media containers.</title> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<video></video> +<script> +test(function() { + var video = document.querySelector('video'); + // These tests may be expected to fail if the platform does not support the format. + assert_equals(video.canPlayType('audio/webm'), 'maybe'); + assert_equals(video.canPlayType('video/webm'), 'maybe'); + + assert_equals(video.canPlayType('audio/webm; codecs=vorbis'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs="vp8,vorbis"'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs=vp8'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs=vp8.0'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs="vp8.0,vorbis"'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs=vp8.1'), ''); + + assert_equals(video.canPlayType('video/webm; codecs=vp9'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs="vp9,vorbis"'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs=vp9.0'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs="vp9.0,vorbis"'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs=vp9.1'), ''); + + assert_equals(video.canPlayType('audio/webm; codecs=opus'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs="vp9,opus"'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs="vp9.0,opus"'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs="vp8,opus"'), 'probably'); + assert_equals(video.canPlayType('video/webm; codecs="vp8.0,opus"'), 'probably'); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html b/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html index e2a0aabb..9565c03 100644 --- a/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html +++ b/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html
@@ -2,12 +2,13 @@ <title>Tests that adding a text track does not make controls visible.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.oncanplaythrough = t.step_func_done(function() { // Initial state: no text tracks, controls should not be visible.
diff --git a/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html b/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html index 6e9eaf29..fb9aaed8 100644 --- a/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html +++ b/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html
@@ -2,16 +2,17 @@ <title>Test that media keeps playing when the source element is replaced.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <audio></audio> <script> async_test(function(t) { // TODO(srirama.m): Improve the test for better understanding var timeupdateEventCount = 0; var sourceReplaced = false; - + var audio = document.querySelector("audio"); var source = document.createElement("source"); - source.src = "content/silence.oga"; + source.src = findMediaFile("audio", "content/silence"); audio.appendChild(source); audio.onerror = t.unreached_func(); @@ -33,10 +34,10 @@ // Replacing the media's source element. sourceReplaced = true; timeupdateEventCount = 0; - + audio.removeChild(source); var newSource = document.createElement("source"); - newSource.src = "content/test.oga"; + newSource.src = findMediaFile("audio", "content/test"); audio.appendChild(newSource); } else { t.done();
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html b/third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html index 62d29a1..6a849f9 100644 --- a/third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html +++ b/third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html
@@ -14,7 +14,7 @@ <video id="video" width="300px" controls></video> <script> var element = document.getElementById("video"); - element.src = "content/counting.ogv"; + element.src = findMediaFile("video", "content/counting"); function testTimelineVisible(test) { // Check that the timeline is shown. If zoom is not accounted for,
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-hide-menu-stoppropagation.html b/third_party/WebKit/LayoutTests/media/media-controls-hide-menu-stoppropagation.html index de7ab9b..72145c4 100644 --- a/third_party/WebKit/LayoutTests/media/media-controls-hide-menu-stoppropagation.html +++ b/third_party/WebKit/LayoutTests/media/media-controls-hide-menu-stoppropagation.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <script src="overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.setAttribute("width", "60"); // Add captions var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html b/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html index daae64d..e0081c6 100644 --- a/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html +++ b/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html
@@ -2,12 +2,13 @@ <title>This tests that media element controls are reset to their default state when the src is changed to an invalid url.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.oncanplaythrough = t.step_func(function() { video.oncanplaythrough = null;
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-overflow-hidden.html b/third_party/WebKit/LayoutTests/media/media-controls-overflow-hidden.html index 8b55e97..dea8af9 100644 --- a/third_party/WebKit/LayoutTests/media/media-controls-overflow-hidden.html +++ b/third_party/WebKit/LayoutTests/media/media-controls-overflow-hidden.html
@@ -9,6 +9,7 @@ <meta name='viewport' content='width=800'> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> </head> <style> @@ -33,7 +34,7 @@ var videos = document.querySelectorAll('video'); for (var i=0; i < videos.length; ++i) { - videos[i].src = 'content/test.ogv'; + videos[i].src = findMediaFile('video', 'content/test'); } var forceLayout = document.body.offsetHeight;
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html b/third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html index 210ec351..89b3089 100644 --- a/third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html +++ b/third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html
@@ -9,6 +9,7 @@ <meta name='viewport' content='width=300'> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> </head> <body> @@ -28,7 +29,7 @@ var videos = document.querySelectorAll('video'); for (var i=0; i < videos.length; ++i) { - videos[i].src = 'content/test.ogv'; + videos[i].src = findMediaFile('video', 'content/test'); } var forceLayout = document.body.offsetHeight;
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-tap-show-controls-without-activating.html b/third_party/WebKit/LayoutTests/media/media-controls-tap-show-controls-without-activating.html index 8ce4736..16a0c6f 100644 --- a/third_party/WebKit/LayoutTests/media/media-controls-tap-show-controls-without-activating.html +++ b/third_party/WebKit/LayoutTests/media/media-controls-tap-show-controls-without-activating.html
@@ -2,12 +2,13 @@ <title>Test that when tapping on the controls to show them it does not activate the button below.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls loop></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.play(); video.onplaying = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html b/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html index 1a1ae92..be4404e3 100644 --- a/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html +++ b/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html
@@ -2,12 +2,13 @@ <title>This test ensures that media element fires the "playing" event every time it starts playing after eos. It also ensure that "pause" and "ended" events are fired when media playback ends.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <audio></audio> <script> async_test(function(t) { var loop = true; var audio = document.querySelector("audio"); - audio.src = "content/silence.oga"; + audio.src = findMediaFile("audio", "content/silence"); var watcher = new EventWatcher(t, audio, ["loadedmetadata", "playing", "pause", "ended"]); watcher.wait_for("loadedmetadata").then(t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/media-ended.html b/third_party/WebKit/LayoutTests/media/media-ended.html index 10157c21..3e15554f 100644 --- a/third_party/WebKit/LayoutTests/media/media-ended.html +++ b/third_party/WebKit/LayoutTests/media/media-ended.html
@@ -2,6 +2,7 @@ <title>Test "ended" event fires again after changing source after "ended" event.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <audio autoplay></audio> <script> async_test(function(t) { @@ -28,7 +29,7 @@ } // Change src but don't seek so that internal state isn't reset. - audio.src = "content/silence.oga"; + audio.src = findMediaFile("audio", "content/silence"); assert_false(audio.ended); break; @@ -39,6 +40,6 @@ } }); - audio.src = "content/silence.oga" + audio.src = findMediaFile("audio", "content/silence") }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html b/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html index dbd5412..04df5d913f 100644 --- a/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html +++ b/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html
@@ -2,12 +2,13 @@ <title>Test that a media url with fragment loads properly</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); video.onloadeddata = t.step_func_done(); video.onerror = t.unreached_func(); - video.src = "content/test.ogv" + "#01.00.xyz"; + video.src = findMediaFile("video", "content/test") + "#01.00.xyz"; }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-file.js b/third_party/WebKit/LayoutTests/media/media-file.js index 80eef5c..c80abcb 100644 --- a/third_party/WebKit/LayoutTests/media/media-file.js +++ b/third_party/WebKit/LayoutTests/media/media-file.js
@@ -10,6 +10,25 @@ ["video/webm","webm"] ]; +function findMediaFile(tagName, name) { + var codecs; + if (tagName == "audio") + codecs = audioCodecs; + else + codecs = videoCodecs; + + var element = document.getElementsByTagName(tagName)[0]; + if (!element) + element = document.createElement(tagName); + + for (var i = 0; i < codecs.length; ++i) { + if (element.canPlayType(codecs[i][0])) + return name + "." + codecs[i][1]; + } + + return ""; +} + function mimeTypeForExtension(extension) { for (var i = 0; i < videoCodecs.length; ++i) { if (extension == videoCodecs[i][1])
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/media-fragments.js b/third_party/WebKit/LayoutTests/media/media-fragments/media-fragments.js index ed40715..fd6cc1e72 100644 --- a/third_party/WebKit/LayoutTests/media/media-fragments/media-fragments.js +++ b/third_party/WebKit/LayoutTests/media/media-fragments/media-fragments.js
@@ -2,7 +2,7 @@ var consoleDiv = null; var currentTest = null; var fragmentEndTime; - var testData = + var testData = { // http://www.w3.org/2008/WebVideo/Fragments/TC/ua-test-cases @@ -231,10 +231,10 @@ function start() { video = document.createElement('video'); - video.setAttribute('id', 'vid'); - video.setAttribute('width', '320'); - video.setAttribute('height', '240'); - video.setAttribute('controls', ''); + video.setAttribute('id', 'vid'); + video.setAttribute('width', '320'); + video.setAttribute('height', '240'); + video.setAttribute('controls', ''); var paragraph = document.createElement('p'); paragraph.appendChild(video); document.body.appendChild(paragraph); @@ -249,6 +249,6 @@ consoleWrite("<br>Title: <b>" + currentTest + "</b>"); consoleWrite("Fragment: '<i>" + info.fragment + "</i>'"); consoleWrite("Comment: <i>" + info.comment + "</i>"); - url = "../content/counting.ogv" + "#" + info.fragment; + url = findMediaFile("video", "../content/counting") + "#" + info.fragment; video.src = url; } \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-load-event.html b/third_party/WebKit/LayoutTests/media/media-load-event.html index 25f80ce..c6b2ef1 100644 --- a/third_party/WebKit/LayoutTests/media/media-load-event.html +++ b/third_party/WebKit/LayoutTests/media/media-load-event.html
@@ -2,6 +2,7 @@ <title>Test that media file is not reloaded when an element is inserted into the DOM.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <div id="parent"></div> <script> async_test(function(t) { @@ -19,7 +20,7 @@ audio.onplay = t.step_func(function() {}); audio.onloadeddata = t.step_func(function() {}); - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.load(); }) </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-play-promise.html b/third_party/WebKit/LayoutTests/media/media-play-promise.html index 0c14e9e..e70ef77a 100644 --- a/third_party/WebKit/LayoutTests/media/media-play-promise.html +++ b/third_party/WebKit/LayoutTests/media/media-play-promise.html
@@ -2,6 +2,7 @@ <title>Test the play() behaviour with regards to the returned promise for media elements.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> // This is testing the behavior of play() with regards to the returned // promise. This test file is creating a small framework in order to be able @@ -13,7 +14,7 @@ // Test that play() on an element that doesn't have enough data will // return a promise that resolves successfully. function playBeforeCanPlay(t, audio) { - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); assert_equals(audio.readyState, HTMLMediaElement.HAVE_NOTHING); playExpectingResolvedPromise(t, audio); }, @@ -21,7 +22,7 @@ // Test that play() on an element that has enough data will return a // promise that resolves successfully. function playWhenCanPlay(t, audio) { - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.oncanplay = t.step_func(function() { assert_greater_than_equal(audio.readyState, HTMLMediaElement.HAVE_FUTURE_DATA); @@ -34,7 +35,7 @@ // promise that resolves successfully. function playAfterPlaybackStarted(t, audio) { audio.preload = "auto"; - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.onplaying = t.step_func(function() { assert_equals(audio.readyState, HTMLMediaElement.HAVE_ENOUGH_DATA); @@ -50,7 +51,7 @@ // Test that play() on an element with an unsupported content will // return a rejected promise. function playNotSupportedContent(t, audio) { - audio.src = "data:,.oga"; + audio.src = findMediaFile("audio", "data:,"); audio.onerror = t.step_func(function() { assert_true(audio.error instanceof MediaError); @@ -64,7 +65,7 @@ // This test doesn't test a spec behaviour but tests that the Blink // implementation properly changed after the spec changed. function playDecodeError(t, audio) { - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.onerror = t.step_func(function() { assert_true(audio.error instanceof MediaError); @@ -83,7 +84,7 @@ // This test doesn't test a spec behaviour but tests that the Blink // implementation properly changed after the spec changed function playNetworkError(t, audio) { - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.onerror = t.step_func(function() { assert_true(audio.error instanceof MediaError); @@ -100,7 +101,7 @@ // Test that play() returns a rejected promise if the element is // sufferring from a not supported error. function playWithErrorAlreadySet(t, audio) { - audio.src = "data:,.oga"; + audio.src = findMediaFile("audio", "data:,"); audio.onerror = t.step_func(function() { assert_true(audio.error instanceof MediaError); @@ -112,12 +113,12 @@ // Test that play() returns a resolved promise if the element had its // source changed after suffering from an error. function playSrcChangedAfterError(t, audio) { - audio.src = "data:,.oga"; + audio.src = findMediaFile("audio", "data:,"); audio.onerror = t.step_func(function() { assert_true(audio.error instanceof MediaError); assert_equals(audio.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED); - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.onloadedmetadata = t.step_func(function() { playExpectingResolvedPromise(t, audio); @@ -128,12 +129,12 @@ // Test that play() returns a rejected promise if the element had an // error and just changed its source. function playRaceWithSrcChangeError(t, audio) { - audio.src = "data:,.oga"; + audio.src = findMediaFile("audio", "data:,"); audio.onerror = t.step_func(function() { assert_true(audio.error instanceof MediaError); assert_equals(audio.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED); - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); assert_equals(audio.error, null); assert_equals(audio.readyState, HTMLMediaElement.HAVE_NOTHING); playExpectingResolvedPromise(t, audio); @@ -145,7 +146,7 @@ // words, pause() doesn't cancel play() because it was resolved // immediately. function playAndPauseWhenCanplay(t, audio) { - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.oncanplaythrough = t.step_func(function() { assert_equals(audio.readyState, HTMLMediaElement.HAVE_ENOUGH_DATA); @@ -178,13 +179,13 @@ // Test that changing the src rejects the pending play() promises. function newSrcRejectPendingPromises(t, audio) { playExpectingRejectedPromise(t, audio, "AbortError"); // the promise will be left pending. - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); }, // Test ordering of events and promises. // This is testing a bug in Blink, see https://crbug.com/587871 function testEventAndPromiseOrdering(t, audio) { - audio.src = "data:,.oga"; + audio.src = findMediaFile("audio", "data:,"); audio.onerror = t.step_func(function() { // Until https://crbug.com/587871 is fixed, the events will be @@ -207,7 +208,7 @@ // playing returns a promise that resolves successfully. function pausePlayAfterPlaybackStarted(t, audio) { audio.preload = "auto"; - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); audio.onplaying = t.step_func(function() { assert_equals(audio.readyState, HTMLMediaElement.HAVE_ENOUGH_DATA); @@ -224,11 +225,11 @@ // Test that running the load algorithm will not drop all the promises about // to be resolved. function loadAlgorithmDoesNotCancelTasks(t, audio) { - audio.src = 'content/test.oga'; + audio.src = findMediaFile('audio', 'content/test'); audio.addEventListener('canplaythrough', t.step_func(function() { // The play() promise will be queued to be resolved. playExpectingResolvedPromise(t, audio); - audio.src = 'content/test.oga'; + audio.src = findMediaFile('audio', 'content/test'); assert_true(audio.paused); })); }, @@ -238,7 +239,7 @@ function loadAlgorithmKeepPromisesPendingWhenNotPausing(t, audio) { playExpectingResolvedPromise(t, audio); setTimeout(t.step_func(function() { - audio.src = 'content/test.oga'; + audio.src = findMediaFile('audio', 'content/test'); assert_false(audio.paused); }), 0); }, @@ -246,7 +247,7 @@ // Test that when the load algorithm is run, if it resolves multiple // promises, they are resolved in the order in which they were added. function loadAlgorithmResolveOrdering(t, audio) { - audio.src = 'content/test.oga'; + audio.src = findMediaFile('audio', 'content/test'); audio.addEventListener('canplaythrough', t.step_func(function() { var firstPromiseResolved = false; audio.play().then(t.step_func(_ => firstPromiseResolved = true), @@ -256,7 +257,7 @@ assert_true(firstPromiseResolved); }), t.unreached_func()); - audio.src = 'content/test.oga'; + audio.src = findMediaFile('audio', 'content/test'); })); }, @@ -268,14 +269,14 @@ // function loadAlgorithmKeepPromisesPendingWhenNotPausingAndPreloadNone(t, audio) { // audio.preload = 'none'; // playExpectingRejectedPromise(t, audio, 'AbortError'); - // setTimeout(_ => audio.src = 'content/test.oga', 0); + // setTimeout(_ => audio.src = findMediaFile('audio', 'content/test'), 0); // }, // Test that when the load algorithm is run, if it does pause the playback, // it will reject the pending promises. function loadAlgorithmRejectPromisesWhenPausing(t, audio) { playExpectingRejectedPromise(t, audio, 'AbortError'); - audio.src = 'content/test.oga'; + audio.src = findMediaFile('audio', 'content/test'); assert_true(audio.paused); }, @@ -284,7 +285,7 @@ function loadAlgorithmRejectPromisesWhenPausingAndPreloadNone(t, audio) { audio.preload = 'none'; playExpectingRejectedPromise(t, audio, 'AbortError'); - audio.src = 'content/test.oga'; + audio.src = findMediaFile('audio', 'content/test'); assert_true(audio.paused); }, @@ -308,7 +309,7 @@ setTimeout(t.step_func(function() { audio.pause(); - audio.src = 'content/test.oga'; + audio.src = findMediaFile('audio', 'content/test'); }), 0); }, ]; @@ -325,14 +326,14 @@ // Test that play() on an element when media playback requires a gesture // returns a resolved promise if there is a user gesture. function playRequiresUserGestureAndHasIt(t, audio) { - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); playWithUserGesture(t, audio); }, // Test that play() on an element when media playback requires a gesture // returns a rejected promise if there is no user gesture. function playRequiresUserGestureAndDoesNotHaveIt(t, audio) { - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); playExpectingRejectedPromise(t, audio, "NotAllowedError"); } ];
diff --git a/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html b/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html index f960da8..d2cef33 100644 --- a/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html +++ b/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html
@@ -2,6 +2,7 @@ <title>Test that a media element doesn't reload on removing the current source element and inserting a new source element.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <audio></audio> <script> async_test(function(t) { @@ -18,9 +19,9 @@ }); var sourceA = document.createElement("source"); - sourceA.src = "content/test.oga"; + sourceA.src = findMediaFile("audio", "content/test"); var sourceB = document.createElement("source"); - sourceB.src = "content/silence.oga"; + sourceB.src = findMediaFile("audio", "content/silence"); audio.appendChild(sourceA); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html b/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html index 48fe3da..f2eaae0 100644 --- a/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html +++ b/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html
@@ -2,6 +2,7 @@ <title>Test that media autoplay should not work if user gesture is required for playback.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> internals.settings.setAutoplayPolicy('user-gesture-required'); </script> @@ -9,7 +10,7 @@ <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); assert_true(video.paused); video.onplay = t.unreached_func();
diff --git a/third_party/WebKit/LayoutTests/media/play-promise-crash.html b/third_party/WebKit/LayoutTests/media/play-promise-crash.html index da5cf53e..9e23035 100644 --- a/third_party/WebKit/LayoutTests/media/play-promise-crash.html +++ b/third_party/WebKit/LayoutTests/media/play-promise-crash.html
@@ -6,12 +6,13 @@ <body> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> window.internals.settings.setAutoplayPolicy('user-gesture-required'); async_test(function(t) { var video = document.createElement('video'); - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); video.play().then(t.step_func_done(function() { assert_unreached(); }), t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/remoteplayback/availability-callback-gc.html b/third_party/WebKit/LayoutTests/media/remoteplayback/availability-callback-gc.html index 1c28408..c4135ae2 100644 --- a/third_party/WebKit/LayoutTests/media/remoteplayback/availability-callback-gc.html +++ b/third_party/WebKit/LayoutTests/media/remoteplayback/availability-callback-gc.html
@@ -5,13 +5,14 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../../resources/gc.js"></script> - </head> + <script src="../media-file.js"></script> + </head> <body> <script> async_test(function(t) { var v = document.createElement('video'); - v.src = '../content/test.ogv'; + v.src = findMediaFile('video', '../content/test'); document.body.appendChild(v); function callback(available) {}
diff --git a/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html b/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html index 3abd9429..1f363b9 100644 --- a/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html +++ b/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html
@@ -4,7 +4,8 @@ <title>Test that calling prompt() before the promise returned by the previous call is resolved throws an exception</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> - <script src="util.js"></script> + <script src="../media-file.js"></script> + <script src="util.js"></script> </head> <body> <button id="button">Click me</button> @@ -28,7 +29,7 @@ enableRemotePlaybackBackendForTest(test); var v = document.createElement('video'); - v.src = '../content/test.ogv'; + v.src = findMediaFile('video', '../content/test'); document.body.appendChild(v); var btn = document.getElementById('button');
diff --git a/third_party/WebKit/LayoutTests/media/remoteplayback/watch-availability-throws-low-end-device.html b/third_party/WebKit/LayoutTests/media/remoteplayback/watch-availability-throws-low-end-device.html index 7c03647..60d46036 100644 --- a/third_party/WebKit/LayoutTests/media/remoteplayback/watch-availability-throws-low-end-device.html +++ b/third_party/WebKit/LayoutTests/media/remoteplayback/watch-availability-throws-low-end-device.html
@@ -4,7 +4,8 @@ <title>Test that watchAvailability() throws on low-end devices.</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> - <script src="util.js"></script> + <script src="../media-file.js"></script> + <script src="util.js"></script> </head> <body> <script> @@ -14,7 +15,7 @@ { enableRemotePlaybackBackendForTest(t); var v = document.createElement('video'); - v.src = '../content/test.ogv'; + v.src = findMediaFile('video', '../content/test'); document.body.appendChild(v); internals.setIsLowEndDevice(true); v.remote.watchAvailability(t.unreached_func()).then(
diff --git a/third_party/WebKit/LayoutTests/media/remove-from-document.html b/third_party/WebKit/LayoutTests/media/remove-from-document.html index a4a29d9..756b09f 100644 --- a/third_party/WebKit/LayoutTests/media/remove-from-document.html +++ b/third_party/WebKit/LayoutTests/media/remove-from-document.html
@@ -2,11 +2,12 @@ <title>Test that removing a media element from the tree pauses playback but does not unload the media.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video autoplay></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.oncanplaythrough = t.step_func_done(function() { assert_not_equals(video.networkState, HTMLMediaElement.NETWORK_EMPTY);
diff --git a/third_party/WebKit/LayoutTests/media/resources/video-stop-propagation.html b/third_party/WebKit/LayoutTests/media/resources/video-stop-propagation.html index a92a8c04..c8342f7 100644 --- a/third_party/WebKit/LayoutTests/media/resources/video-stop-propagation.html +++ b/third_party/WebKit/LayoutTests/media/resources/video-stop-propagation.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <html> +<script src="../media-file.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> <body style="padding-top: 100px; padding-left: 100px"> <video controls width=60></video> @@ -7,7 +8,7 @@ <script> // Set up video var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); // Add captions var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/seek-to-currentTime.html b/third_party/WebKit/LayoutTests/media/seek-to-currentTime.html index e657ba6..d329178 100644 --- a/third_party/WebKit/LayoutTests/media/seek-to-currentTime.html +++ b/third_party/WebKit/LayoutTests/media/seek-to-currentTime.html
@@ -3,12 +3,13 @@ <title>seek to currentTime</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <div id=log></div> <script> // TODO(srirama.m): Remove this test by importing the above web-platform-tests test async_test(function(t) { var v = document.createElement('video'); - v.src = 'content/test.ogv'; + v.src = findMediaFile('video', 'content/test'); v.onloadedmetadata = t.step_func(function() { assert_greater_than(v.readyState, v.HAVE_NOTHING, 'readyState'); assert_greater_than(v.seekable.length, 0, 'seekable ranges');
diff --git a/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable-expected.html b/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable-expected.html index 97b8d00..320cde41 100644 --- a/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable-expected.html +++ b/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable-expected.html
@@ -27,7 +27,7 @@ function init() { - setSrcByTagName("video", "../content/test.ogv"); + setSrcByTagName("video", findMediaFile("video", "../content/test")); var totalCount = document.getElementsByTagName('video').length; var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable.html b/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable.html index 696bf68..c51976a 100644 --- a/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable.html +++ b/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable.html
@@ -18,7 +18,7 @@ function init() { - setSrcByTagName("video", "../content/test.ogv"); + setSrcByTagName("video", findMediaFile("video", "../content/test")); var totalCount = document.getElementsByTagName('video').length; var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.html b/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.html index c7ba4dec24..3f12558 100644 --- a/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.html +++ b/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that the cue is styled when video and style is in the same shadow tree.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -12,7 +13,7 @@ shadowRoot.innerHTML = '<style>video::cue(.red, .red2) { color:red } video::cue(.green) { color:green }</style>' + '<video controls ><track src="captions-webvtt/styling-lifetime.vtt" kind="captions" default></video>'; var video = shadowRoot.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.id = "testvideo"; video.onseeked = t.step_func_done(function() { var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstElementChild;
diff --git a/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html b/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html index edd6b1aa..35279e2 100644 --- a/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html +++ b/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that the cue is not styled when video is in a shadow tree and style is in a document.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -15,7 +16,7 @@ var shadowRoot = host.createShadowRoot(); shadowRoot.innerHTML = '<video controls ><track src="captions-webvtt/styling-lifetime.vtt" kind="captions" default></video>'; var video = shadowRoot.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.id = "testvideo"; video.onseeked = t.step_func_done(function() { var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstElementChild;
diff --git a/third_party/WebKit/LayoutTests/media/track/cue-style-invalidation.html b/third_party/WebKit/LayoutTests/media/track/cue-style-invalidation.html index 903aa070..d29b02d0 100644 --- a/third_party/WebKit/LayoutTests/media/track/cue-style-invalidation.html +++ b/third_party/WebKit/LayoutTests/media/track/cue-style-invalidation.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Check that descendant style invalidation works with ::cue selectors.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -22,7 +23,7 @@ <script> async_test(function(t) { var video = document.querySelector('video'); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.onseeked = t.step_func_done(function() { var red = "rgb(255, 0, 0)"; var green = "rgb(0, 128, 0)";
diff --git a/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html b/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html index 1050637d..561f98d 100644 --- a/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html +++ b/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html
@@ -3,6 +3,7 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../../resources/gc.js"></script> +<script src="../media-file.js"></script> <video autoplay> <track src="captions-webvtt/captions-fast.vtt" default> </video> @@ -20,7 +21,7 @@ function CFcrash() { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); var document1 = document.implementation.createDocument("", null); document1.appendChild(video); delete document1;
diff --git a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-display.html b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-display.html index 48d37a0..33b3243 100644 --- a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-display.html +++ b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-display.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <title>Tests default rendering for TextTrackCues that belong to a VTTRegion.</title> <script src="../../media-controls.js"></script> +<script src="../../media-file.js"></script> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> <video controls></video> @@ -32,7 +33,7 @@ async_test(function() { var video = document.querySelector('video'); - video.src = '../../content/test.ogv'; + video.src = findMediaFile('video', '../../content/test'); var testTrack = document.createElement('track'); testTrack.onload = this.step_func(function() { video.oncanplaythrough = this.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html index 3969a0f..f37ecd64 100644 --- a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html +++ b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html
@@ -1,12 +1,13 @@ <!DOCTYPE html> <title>Tests default DOM layout structure for a VTTRegion.</title> <script src="../../media-controls.js"></script> +<script src="../../media-file.js"></script> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> <script> async_test(function() { var video = document.createElement('video'); - video.src = '../../content/test.ogv'; + video.src = findMediaFile('video', '../../content/test'); var testTrack = document.createElement('track'); testTrack.onload = this.step_func(function() { video.oncanplaythrough = this.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-non-visible-crash.html b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-non-visible-crash.html index 8428b7f..c5dc3e3 100644 --- a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-non-visible-crash.html +++ b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-non-visible-crash.html
@@ -2,11 +2,12 @@ <title>Box-less VTTCue attached to VTTRegion should not crash</title> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> +<script src="../../media-file.js"></script> <video></video> <script> setup(function() { window.video = document.querySelector('video'); - video.src = '../../content/test.ogv'; + video.src = findMediaFile('video', '../../content/test'); }); async_test(function(t) { let track = video.addTextTrack('subtitles');
diff --git a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html index be3e2f6..f27add7 100644 --- a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html +++ b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests proper parsing of various regions present in WebVTT header area.</title> +<script src="../../media-file.js"></script> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> <script> @@ -34,7 +35,7 @@ async_test(function(t) { var video = document.createElement('video'); - video.src = '../../content/test.ogv'; + video.src = findMediaFile('video', '../../content/test'); var testTrack = document.createElement('track'); testTrack.onload = t.step_func_done(function() { var track = testTrack.track;
diff --git a/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html b/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html index 63cf1d80..c62e8d3 100644 --- a/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html +++ b/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html
@@ -2,6 +2,7 @@ <title>Test that we can add a track dynamically and it is displayed on the track selection menu.</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <!-- Width should be large enough to display closed captions button. --> <video controls style="width: 500px"> @@ -30,6 +31,6 @@ assert_equals(textTrackDisplayElement(video).innerText, trackCueText); }); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); }) </script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-all-cues.html b/third_party/WebKit/LayoutTests/media/track/track-css-all-cues.html index dc12ee7..5199bab 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-css-all-cues.html +++ b/third_party/WebKit/LayoutTests/media/track/track-css-all-cues.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that style to all cues is applied correctly.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -18,8 +19,8 @@ <script> async_test(function(t) { var video = document.querySelector('video'); - video.src = '../content/test.ogv'; - + video.src = findMediaFile('video', '../content/test'); + var track = document.createElement('track'); track.src = 'captions-webvtt/styling.vtt'; track.kind = 'captions';
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-cue-lifetime.html b/third_party/WebKit/LayoutTests/media/track/track-css-cue-lifetime.html index f7e503c6..e7f2b7a5 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-css-cue-lifetime.html +++ b/third_party/WebKit/LayoutTests/media/track/track-css-cue-lifetime.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that the cue is styled properly throughout its lifetime.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -14,9 +15,9 @@ var step = 0.4; var initialTime = 0.6; var endTime = 3.0 - + var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); var track = document.createElement('track'); track.src = 'captions-webvtt/styling-lifetime.vtt'; @@ -38,7 +39,7 @@ else video.currentTime = seekTime; }); - + video.currentTime = initialTime; }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html b/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html index d5cb191..7742217 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html +++ b/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that u, b, i WebVTT objects are being styled correctly.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -7,8 +8,8 @@ <script> async_test(function(t) { var video = document.querySelector('video'); - video.src = '../content/test.ogv'; - + video.src = findMediaFile('video', '../content/test'); + var track = document.createElement('track'); track.src = 'captions-webvtt/styling-default.vtt'; track.kind = 'captions'; @@ -23,7 +24,7 @@ cueNode = cueNode.nextElementSibling; assert_equals(getComputedStyle(cueNode).textDecoration, 'underline solid rgb(255, 255, 255)'); }); - + video.currentTime = 0.1; }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-matching-lang.html b/third_party/WebKit/LayoutTests/media/track/track-css-matching-lang.html index 0ee9681..60629f06 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-css-matching-lang.html +++ b/third_party/WebKit/LayoutTests/media/track/track-css-matching-lang.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that cues are being matched properly by the lang attribute and :lang() pseudo class.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -12,8 +13,8 @@ <script> async_test(function(t) { var video = document.querySelector('video'); - video.src = '../content/test.ogv'; - + video.src = findMediaFile('video', '../content/test'); + var track = document.createElement('track'); track.src = 'captions-webvtt/styling-lang.vtt'; track.kind = 'captions'; @@ -28,7 +29,7 @@ cueNode = cueNode.firstElementChild.firstElementChild; assert_equals(getComputedStyle(cueNode).color, 'rgb(128, 0, 128)'); }); - + video.currentTime = 0.1; }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-matching-timestamps.html b/third_party/WebKit/LayoutTests/media/track/track-css-matching-timestamps.html index 8e89355..c9fb1a2 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-css-matching-timestamps.html +++ b/third_party/WebKit/LayoutTests/media/track/track-css-matching-timestamps.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that cues are being matched properly by :past and :future pseudo classes.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -19,10 +20,10 @@ ["rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(128, 128, 128)", "rgb(128, 128, 128)", "rgb(128, 128, 128)"], ["rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(128, 128, 128)", "rgb(0, 255, 0)"], ["rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(0, 255, 0)"]]; - + var video = document.querySelector("video"); - video.src = "../content/test.ogv"; - + video.src = findMediaFile("video", "../content/test"); + var track = document.createElement("track"); track.src = "captions-webvtt/styling-timestamps.vtt"; track.kind = "captions";
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-matching.html b/third_party/WebKit/LayoutTests/media/track/track-css-matching.html index d14b56f8..77e8759f 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-css-matching.html +++ b/third_party/WebKit/LayoutTests/media/track/track-css-matching.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that cues are being matched properly by various CSS Selectors.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -29,8 +30,8 @@ ["rgb(255, 255, 0)", "rgb(255, 0, 0)", "rgb(0, 128, 0)"]]; var video = document.querySelector("video"); - video.src = "../content/test.ogv"; - + video.src = findMediaFile("video", "../content/test"); + var track = document.createElement("track"); track.src = "captions-webvtt/styling.vtt"; track.kind = "captions"; @@ -51,7 +52,7 @@ else video.currentTime = seekTimes[seekTimeIndex]; }); - + video.currentTime = seekTimes[seekTimeIndex]; }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-property-whitelist.html b/third_party/WebKit/LayoutTests/media/track/track-css-property-whitelist.html index d3fd1057..b2a45b3 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-css-property-whitelist.html +++ b/third_party/WebKit/LayoutTests/media/track/track-css-property-whitelist.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that ::cue pseudo-element properties are applied to WebVTT node objects only.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -18,7 +19,7 @@ <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.onseeked = t.step_func_done(function() { var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstElementChild; @@ -26,13 +27,13 @@ assert_equals(cueStyle.color, "rgb(255, 0, 0)"); assert_equals(cueStyle.padding, "0px"); assert_equals(cueStyle.wordSpacing, "0px"); - + cueNode = cueNode.nextElementSibling; cueStyle = getComputedStyle(cueNode); assert_equals(cueStyle.color, "rgb(255, 0, 0)"); assert_equals(cueStyle.padding, "0px"); assert_equals(cueStyle.wordSpacing, "0px"); - + cueNode = cueNode.nextElementSibling; cueStyle = getComputedStyle(cueNode); assert_equals(cueStyle.color, "rgb(255, 0, 0)");
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-author-settings.html b/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-author-settings.html index 52dad36..1ab12b12 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-author-settings.html +++ b/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-author-settings.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that WebVTT objects are being styled correctly based on user settings that should override author settings.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -21,7 +22,7 @@ <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.oncanplaythrough = t.step_func_done(function() { var cue = textTrackCueElementByIndex(video, 0).firstChild.firstElementChild; @@ -33,7 +34,7 @@ assert_equals(cueStyle.fontFamily, "arial"); assert_equals(cueStyle.fontStyle, "normal"); assert_equals(cueStyle.fontVariant, "normal"); - + // Apply user settings and verify they override author-specified settings internals.settings.setTextTrackTextColor("cyan"); internals.settings.setTextTrackBackgroundColor("green"); @@ -42,7 +43,7 @@ internals.settings.setTextTrackFontFamily("fantasy"); internals.settings.setTextTrackFontStyle("italic"); internals.settings.setTextTrackFontVariant("small-caps"); - + video.currentTime = 0.3; cue = textTrackCueElementByIndex(video, 0).firstChild.firstElementChild;
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-internal-settings.html b/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-internal-settings.html index 5627716..cde58678 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-internal-settings.html +++ b/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-internal-settings.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that WebVTT objects are being styled correctly based on user settings that should override default settings.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -9,7 +10,7 @@ <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.oncanplaythrough = t.step_func_done(function() { var cue = textTrackCueElementByIndex(video, 0).firstChild; @@ -19,7 +20,7 @@ assert_equals(cueStyle.color, "rgb(255, 255, 255)"); assert_equals(cueStyle.backgroundColor, "rgba(0, 0, 0, 0.8)"); assert_equals(cueStyle.fontFamily, "sans-serif"); - + // Apply user settings for color and font-size and verify that the other internal settings are retained. internals.settings.setTextTrackTextColor("purple"); internals.settings.setTextTrackTextSize("14px");
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html b/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html index 2aa5188..0bde8e03 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>The top of the text track container should be in the bottom 25% of the video element.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -14,8 +15,8 @@ <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; - + video.src = findMediaFile("video", "../content/test"); + video.oncanplaythrough = t.step_func_done(function() { var cueDisplayElement = textTrackDisplayElement(video); document.body.offsetTop; // Force layout.
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html b/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html index 6f4f286..96ed4cf 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html
@@ -2,13 +2,14 @@ <title>Tests that added cue object wrappers live across garbage collections.</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <video></video> <script> async_test(function(t) { var cueIndex = 0; var cueLimit = 10; var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.textTracks.custom = "trackList"; assert_true(video.textTracks.hasOwnProperty("custom"));
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html index cb6f355b..e872421d4 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that cue fragment is mutable.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <style> @@ -80,6 +81,6 @@ fragment.appendChild(document.createTextNode(" amet,")); } - video.src = "../content/counting.ogv"; + video.src = findMediaFile("video", "../content/counting"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html index 6f91344..63363f7 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that cue text is mutable.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -67,6 +68,6 @@ t.done(); } - video.src = "../content/counting.ogv"; + video.src = findMediaFile("video", "../content/counting"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-nothing-to-render.html b/third_party/WebKit/LayoutTests/media/track/track-cue-nothing-to-render.html index 1c1c4054..5574fa9 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-nothing-to-render.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-nothing-to-render.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that cues are rendered and removed.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -10,8 +11,8 @@ async_test(function(t) { var video = document.querySelector("video"); var testTrack = document.querySelector("track"); - video.src = "../content/counting.ogv"; - + video.src = findMediaFile("video", "../content/counting"); + var seekTimeIndex = 0; var info = [ 0.5, "",
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-empty-cue-crash.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-empty-cue-crash.html index 48e61741..2f29c82a 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-empty-cue-crash.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-empty-cue-crash.html
@@ -1,11 +1,12 @@ <!DOCTYPE html> <title>Tests that having empty cues does not crash the browser.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script> test(function() { var video = document.createElement("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.addTextTrack("captions", "regular captions track", "en"); video.textTracks[0].addCue(new VTTCue(0, 4, "")); video.play();
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-first-line-box.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-first-line-box.html index 80e3dee..cd865158 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-first-line-box.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-first-line-box.html
@@ -3,12 +3,13 @@ <style> -webkit-media-text-track-display { display: block; } </style> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script> test(function() { var video = document.createElement("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.addTextTrack("captions", "regular captions track", "en"); video.textTracks[0].addCue(new VTTCue(0, 4, "")); video.play();
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html index c68f49a..258e7cd8a 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html
@@ -1,11 +1,12 @@ <!DOCTYPE html> <title>Test, rendering horizontal line-positioned cues.</title> +<script src="../media-file.js"></script> <video> <track src="captions-webvtt/captions-snap-to-lines-set.vtt" kind="captions" default> </video> <script> var video = document.querySelector("video"); -video.src = "../content/test.ogv"; +video.src = findMediaFile("video", "../content/test"); testRunner.waitUntilDone(); video.onseeked = function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit-expected.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit-expected.html index f8bbc33..53e7d28 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit-expected.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit-expected.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> +<script src="../media-file.js"></script> <script> -var mediaFile = '../content/test.ogv'; +var mediaFile = findMediaFile('video', '../content/test'); </script> <style> .container {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit.html index 8628435..a91f8ce 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> +<script src="../media-file.js"></script> <script> -var mediaFile = '../content/test.ogv'; +var mediaFile = findMediaFile('video', '../content/test'); function addCue(track, cueData) { var cue = new VTTCue(0, 10, 'XXX');
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-mode-changed.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-mode-changed.html index 20c2804a..e5fb2fdd 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-mode-changed.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-mode-changed.html
@@ -1,12 +1,13 @@ <!DOCTYPE html> <title>Test that cues are rendered when only the track mode is changed.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script> async_test(function(t) { var video = document.createElement('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.oncanplaythrough = t.step_func_done(function() { addTracks();
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-on-resize.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-on-resize.html index ab656ed..1e11ad51 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-on-resize.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-on-resize.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that line height of cue element isn't overridden by author CSS.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -12,7 +13,7 @@ <script> async_test(function(t) { var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.onseeked = t.step_func_done(function() { var multiLineCueDisplayElement = textTrackDisplayElement(video);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-overscan.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-overscan.html index de9b4ad..738a45f3 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-overscan.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-overscan.html
@@ -1,5 +1,6 @@ <!doctype html> <title>WebVTT overscan margin test</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -20,7 +21,7 @@ video.appendChild(track); document.body.appendChild(video); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.oncanplaythrough = function() { video.currentTime = time; }; video.onseeked = t.step_func(function() { var testCueDisplayBox = textTrackDisplayElement(video);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-expected.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-expected.html index 901df80ac..40ba315 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-expected.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-expected.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> +<script src="../media-file.js"></script> <script> -var mediaFile = '../content/test.ogv'; +var mediaFile = findMediaFile('video', '../content/test'); </script> <style> .container {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl-expected.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl-expected.html index 0654db4e..3971674 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl-expected.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl-expected.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> +<script src="../media-file.js"></script> <script> -var mediaFile = '../content/test.ogv'; +var mediaFile = findMediaFile('video', '../content/test'); </script> <style> .container {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl.html index 10f7c4d..c688b91 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> +<script src="../media-file.js"></script> <script> -var mediaFile = '../content/test.ogv'; +var mediaFile = findMediaFile('video', '../content/test'); function addTrackWithRtlCueData(video, cueData) { var track = video.addTextTrack('subtitles');
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto.html index 12d1911a..31d142f 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> +<script src="../media-file.js"></script> <script> -var mediaFile = '../content/test.ogv'; +var mediaFile = findMediaFile('video', '../content/test'); function addTrackWithCueData(video, cueData) { var track = video.addTextTrack('subtitles');
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-rtl.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-rtl.html index cba774f1..b832cd1 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-rtl.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-rtl.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <title>Test that directionality is set correctly on cues.</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -11,7 +12,7 @@ async_test(function(t) { var testTrack = document.querySelector("track"); var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); var seekedCount = 0; var info = ["تجربة",
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set.html index d08e1f18..1b4e81dc 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that TextTrack's cues are rendered correctly when the snap to lines flag is not set.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -10,7 +11,7 @@ async_test(function(t) { var video = document.querySelector("video"); var testTrack = document.querySelector("track"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); // In Chromium it is the enclosure element, which provides the controls height, otherwise the panel; // both are the second child in the shadow DOM.
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video-expected.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video-expected.html index 5be577f..722ccf9 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video-expected.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video-expected.html
@@ -1,4 +1,5 @@ <!DOCTYPE html> +<script src="../media-file.js"></script> <style> .container { transform: translate(1px, 0px); @@ -26,7 +27,7 @@ <div class="container"> <video> <script> - document.currentScript.parentNode.src = '../content/test.ogv'; + document.currentScript.parentNode.src = findMediaFile('video', '../content/test'); </script> </video> <div class=video><div class="cue"><span>XXX</span></div></div>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video.html index bcaa0e1..d359c55 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video.html
@@ -1,4 +1,5 @@ <!DOCTYPE html> +<script src="../media-file.js"></script> <style> video { transform: translate(1px, 0px); @@ -18,5 +19,5 @@ cue.line = 0; track.addCue(cue); track.mode = 'showing'; -video.src = '../content/test.ogv'; +video.src = findMediaFile('video', '../content/test'); </script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html index 52f74fd..bf8e92d 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests that the cue display tree has been removed properly and no crash happens.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -9,7 +10,7 @@ <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.play(); video.oncanplaythrough = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html index a37f060..8932baee 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html
@@ -1,11 +1,12 @@ <!DOCTYPE html> <title>Test, rendering vertical line-positioned cues with Japanese text.</title> +<script src="../media-file.js"></script> <video> <track src="captions-webvtt/captions-snap-to-lines-set.vtt" kind="captions" default> </video> <script> var video = document.querySelector("video"); -video.src = "../content/test.ogv"; +video.src = findMediaFile("video", "../content/test"); testRunner.waitUntilDone(); video.onseeked = function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html index 82c10c2..4ac19e34 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that the cue root is not constrained by the controls/overlay.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -22,8 +23,8 @@ <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; - + video.src = findMediaFile("video", "../content/test"); + video.onseeked = t.step_func_done(function() { // The width of the controls depends on UA style, so verify that our assumption holds. var controlsContainer = mediaControlsButton(video, "panel"); @@ -32,7 +33,7 @@ var cueRoot = textTrackContainerElement(video); assert_true(parseFloat(getComputedStyle(cueRoot).width) > 800); }); - + video.currentTime = 2; }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html index 9ccce45..27550f0 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests rendering text track cue line with padding set.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -14,7 +15,7 @@ <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.onseeked = t.step_func_done(function() { var cueContainerElement = textTrackContainerElement(video);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering.html index 8a20c33..a0eec76e 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that default positioned TextTrack's cues are rendered correctly.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -11,7 +12,7 @@ async_test(function(t) { var video = document.querySelector("video"); var testTrack = document.querySelector("track"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); var cueTextIndex = 0; var cueText = [ "Lorem", "ipsum", "dolor", "sit" ]; @@ -49,7 +50,7 @@ } })); } - + video.currentTime = 0.5; }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-cuechange.html b/third_party/WebKit/LayoutTests/media/track/track-cues-cuechange.html index 49c0526..c0a85e3 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cues-cuechange.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cues-cuechange.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the cuechange event.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <video> @@ -10,7 +11,7 @@ var video = document.querySelector("video"); var testTrack = document.querySelector("track"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.oncanplaythrough = t.step_func(attemptTests); function attemptTests() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html b/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html index e973204..5c491b1e 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the enter and exits events on TextTrackCue.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <video> @@ -10,8 +11,8 @@ var video = document.querySelector("video"); var testTrack = document.querySelector("track"); - video.src = "../content/test.ogv"; - + video.src = findMediaFile("video", "../content/test"); + video.oncanplaythrough = t.step_func(attemptTests); function attemptTests() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-missed.html b/third_party/WebKit/LayoutTests/media/track/track-cues-missed.html index 9510499f..40f2f75 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cues-missed.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cues-missed.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests that events are triggered for missed (skipped) cues during normal playback.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <video> @@ -10,8 +11,8 @@ var video = document.querySelector("video"); var testTrack = document.querySelector("track"); - video.src = "../content/test.ogv"; - + video.src = findMediaFile("video", "../content/test"); + video.onended = t.step_func_done(); video.oncanplaythrough = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html b/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html index 46f6945..7cea266 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html
@@ -2,6 +2,7 @@ <title>Tests that the video is paused after cues that have pause-on-exit flag are processed.</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <video controls> <track src="captions-webvtt/simple-captions.vtt" default> </video> @@ -25,7 +26,7 @@ }); } } - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.currentTime = 4.00; video.play(); assert_false(video.paused);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html b/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html index cc5fa9d..0cc4399 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html
@@ -2,6 +2,7 @@ <title>Tests TextTrack's activeCues are indexed and updated during video playback.</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <video> <track src="captions-webvtt/cues-overlapping.vtt" kind="subtitles" default> </video> @@ -11,7 +12,7 @@ var track = document.querySelector("track"); track.onload = t.step_func(function() { assert_equals(track.track.cues.length, 3); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.currentTime = 0.5; });
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html b/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html index 10cf7af..e602ee1 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html
@@ -2,13 +2,14 @@ <title>Tests that all events are triggered in chronological order.</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <video> <track src="captions-webvtt/sorted-dispatch.vtt" default> </video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); var track = document.querySelector("track"); track.onload = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html b/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html index 3e558dc..93e5763 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html +++ b/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html
@@ -2,6 +2,7 @@ <title>Tests track deletion during setup.</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <video> <track src="captions-webvtt/metadata.vtt"> </video> @@ -23,6 +24,6 @@ assert_equals(track.track.mode, "disabled"); track.track.mode = "hidden"; - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-disabled-addcue.html b/third_party/WebKit/LayoutTests/media/track/track-disabled-addcue.html index 297556a..147eced 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-disabled-addcue.html +++ b/third_party/WebKit/LayoutTests/media/track/track-disabled-addcue.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test adding cues to a disabled text track. </title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script> @@ -27,7 +28,7 @@ t.done(); }); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.play(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-disabled.html b/third_party/WebKit/LayoutTests/media/track/track-disabled.html index df3423f..5b44aa8 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-disabled.html +++ b/third_party/WebKit/LayoutTests/media/track/track-disabled.html
@@ -3,6 +3,7 @@ <video> <track kind="subtitles" src="captions-webvtt/captions.vtt"/> </video> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script> @@ -22,7 +23,7 @@ t.done(); }); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.play(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-insert-after-load-crash.html b/third_party/WebKit/LayoutTests/media/track/track-insert-after-load-crash.html index 51d146c6..7e2e95ff 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-insert-after-load-crash.html +++ b/third_party/WebKit/LayoutTests/media/track/track-insert-after-load-crash.html
@@ -1,11 +1,12 @@ <!DOCTYPE html> <title>Tests that inserting a track element immediately after a load() doesn't crash.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script> async_test(function(t) { var video = document.createElement('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.load(); video.appendChild(document.createElement('track')); video.onloadedmetadata = t.step_func_done();
diff --git a/third_party/WebKit/LayoutTests/media/track/track-kind-user-preference.html b/third_party/WebKit/LayoutTests/media/track/track-kind-user-preference.html index 62bbfa9..c53f44c 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-kind-user-preference.html +++ b/third_party/WebKit/LayoutTests/media/track/track-kind-user-preference.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Test that user preference for text track kind is honored.</title> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> @@ -20,7 +21,7 @@ internals.settings.setTextTrackKindUserPreference("default"); }); internals.setUserPreferredLanguages(["jp", "es", "en", "fr"]); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); var tracks; var expectedTrack;
diff --git a/third_party/WebKit/LayoutTests/media/track/track-language-preference-no-crash.html b/third_party/WebKit/LayoutTests/media/track/track-language-preference-no-crash.html index c361188..45beef5 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-language-preference-no-crash.html +++ b/third_party/WebKit/LayoutTests/media/track/track-language-preference-no-crash.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests that setting preferences on a track-less video element does not crash.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-language-preference.html b/third_party/WebKit/LayoutTests/media/track/track-language-preference.html index 67c23dca..3edd1d69 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-language-preference.html +++ b/third_party/WebKit/LayoutTests/media/track/track-language-preference.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <title>Tests that the user's preferred languages are honored.</title> <video></video> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html b/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html index 4481615d..81f8be9 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html +++ b/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests that a very large timestamp is parsed correctly.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <video>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html b/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html index ea707af6..4ed7a1e 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html +++ b/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests that cues are properly removed from the active cue list when their track changes mode to disabled.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <video> @@ -10,7 +11,7 @@ var video = document.querySelector("video"); var testTrack = document.querySelector("track"); - video.src = "../content/counting.ogv"; + video.src = findMediaFile("video", "../content/counting"); video.oncanplaythrough = t.step_func(startTest); video.onseeked = t.step_func_done(seeked);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-mode-not-changed-by-new-track.html b/third_party/WebKit/LayoutTests/media/track/track-mode-not-changed-by-new-track.html index bac70940..5a455b1 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-mode-not-changed-by-new-track.html +++ b/third_party/WebKit/LayoutTests/media/track/track-mode-not-changed-by-new-track.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests that a track appended after the initial track configuration does not change other tracks.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <video> @@ -13,7 +14,7 @@ assert_equals(track1.readyState, HTMLTrackElement.NONE); assert_equals(track1.track.mode, 'disabled'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.oncanplaythrough = t.step_func(canplaythrough); track1.onload = t.step_func(metadataTrackLoaded);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-mode-triggers-loading.html b/third_party/WebKit/LayoutTests/media/track/track-mode-triggers-loading.html index a17358d..dc10a5aa 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-mode-triggers-loading.html +++ b/third_party/WebKit/LayoutTests/media/track/track-mode-triggers-loading.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests that a "metadata" track does not load automatically, but does load when the mode is changed.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <video> @@ -14,7 +15,7 @@ assert_equals(track.readyState, HTMLTrackElement.NONE); assert_equals(video.textTracks[0].mode, "disabled"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.oncanplaythrough = t.step_func(canplaythrough); track.onload = t.step_func_done(trackLoaded);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-mode.html b/third_party/WebKit/LayoutTests/media/track/track-mode.html index 99a4ff5..bb4562f 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-mode.html +++ b/third_party/WebKit/LayoutTests/media/track/track-mode.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Tests that the TextTrack mode attribute is appropriately set.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <video> @@ -32,7 +33,7 @@ // Set to known values. setModeAndCheck("disabled"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); video.play(); // Wait for end of first cue (no events should fire while track is disabled). setTimeout(testHiddenAndShowing, 400);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-active-cue-crash.html b/third_party/WebKit/LayoutTests/media/track/track-remove-active-cue-crash.html index 8890631..06e2ab2b 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-remove-active-cue-crash.html +++ b/third_party/WebKit/LayoutTests/media/track/track-remove-active-cue-crash.html
@@ -1,12 +1,13 @@ <!DOCTYPE html> <title>Tests that removing an active cue does not crash the browser.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); // Add a text track to the video element. video.addTextTrack("captions", "regular captions track", "en");
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html b/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html index 5673d8b..040baed 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html +++ b/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>This test makes sure that removing a track by setting video.innerHTML doesn't crash (https://bugs.webkit.org/show_bug.cgi?id=100981). If this test does not crash, it passes.</title> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <video> @@ -23,8 +24,8 @@ video.currentTime = 7.9; firstSeek = false; }); - + video.currentTime = 0.5; - video.src = '../content/counting.ogv'; + video.src = findMediaFile('video', '../content/counting'); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-insert-ready-state.html b/third_party/WebKit/LayoutTests/media/track/track-remove-insert-ready-state.html index fe0ae77..5d602681 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-remove-insert-ready-state.html +++ b/third_party/WebKit/LayoutTests/media/track/track-remove-insert-ready-state.html
@@ -3,12 +3,13 @@ <video> <track src="captions-webvtt/tc004-no-webvtt.vtt" kind="captions" default> </video> +<script src="../media-file.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script> async_test(function(t) { var video = document.querySelector('video'); - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); video.oncanplaythrough = t.step_func(canplaythrough); function canplaythrough() { @@ -22,7 +23,7 @@ document.body.removeChild(video); // Reset the video src attribute to re-trigger resource selection for tracks. - video.src = '../content/test.ogv'; + video.src = findMediaFile('video', '../content/test'); // Append the video element back to the body. document.body.appendChild(video);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html b/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html index 3266eea..8649029 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html +++ b/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html
@@ -2,9 +2,10 @@ <title>This test that removing a track element before it has been processed doesn't crash (https://bugs.webkit.org/show_bug.cgi?id=85095).</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <div id="video_container"></div> <script> -var mediaFile = "../content/test.ogv"; +var mediaFile = findMediaFile("video", "../content/test"); document.getElementById("video_container").innerHTML = "<video src='" + mediaFile + "' controls ><track kind='captions' src='captions-webvtt/simple-captions.vtt' default ></video>"; test(function() { // Test passes if it doesn't crash.
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-track.html b/third_party/WebKit/LayoutTests/media/track/track-remove-track.html index 73d0349b..a432428 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-remove-track.html +++ b/third_party/WebKit/LayoutTests/media/track/track-remove-track.html
@@ -3,7 +3,8 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <script src="../../resources/testharness.js"></script> + <script src="../media-file.js"></script> + <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> </head> <body>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines-expected.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines-expected.html index 3dd6fca5..877333d7 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines-expected.html +++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines-expected.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Reference test for track-webvtt-non-snap-to-lines.html.</title> +<script src="../media-file.js"></script> <style> .container { position: relative; @@ -18,7 +19,7 @@ <div class="container"> <video> <script> - document.currentScript.parentNode.src = '../content/test.ogv'; + document.currentScript.parentNode.src = findMediaFile('video', '../content/test'); </script> </video> <span class="cue">Bear is Coming!!!!!</div>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines.html index 0bc4e12..3e45b33 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines.html +++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines.html
@@ -5,6 +5,7 @@ background: green; } </style> +<script src="../media-file.js"></script> <video></video> <script> var video = document.querySelector("video"); @@ -15,5 +16,5 @@ cue.align = "left"; track.addCue(cue); track.mode = "showing"; -video.src = "../content/test.ogv"; +video.src = findMediaFile("video", "../content/test"); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html b/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html index 24d151e..b1a606cb 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html +++ b/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html
@@ -2,6 +2,7 @@ <title>Test that line breaks are forced in captions.</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> +<script src="../media-file.js"></script> <script src="../media-controls.js"></script> <video> <track src="captions-webvtt/long-word.vtt" kind="captions" default> @@ -21,7 +22,7 @@ assert_greater_than(multiLineCaptionHeight / singleLineCaptionHeight, 2); }); - video.src = "../content/test.ogv"; + video.src = findMediaFile("video", "../content/test"); function getCaptionLineHeight() { var captionElement = textTrackContainerElement(video).firstChild.firstChild;
diff --git a/third_party/WebKit/LayoutTests/media/unsupported-tracks.html b/third_party/WebKit/LayoutTests/media/unsupported-tracks.html index 09e5077..f1fd3bc 100644 --- a/third_party/WebKit/LayoutTests/media/unsupported-tracks.html +++ b/third_party/WebKit/LayoutTests/media/unsupported-tracks.html
@@ -2,11 +2,12 @@ <title>Test that QuickTime file with unsupported track types only, generates an error.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/unsupported_track.ogv"; + video.src = findMediaFile("video", "content/unsupported_track"); video.onerror = t.step_func_done(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-append-source.html b/third_party/WebKit/LayoutTests/media/video-append-source.html index 3152888..4a97b68 100644 --- a/third_party/WebKit/LayoutTests/media/video-append-source.html +++ b/third_party/WebKit/LayoutTests/media/video-append-source.html
@@ -2,12 +2,13 @@ <title>Verify that a media element's currentSrc is correctly set to source element's src</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); assert_equals(video.currentSrc, ""); - var mediaFile = "content/test.ogv"; + var mediaFile = findMediaFile("video", "content/test"); var source = document.createElement("source"); source.src = mediaFile; video.appendChild(source);
diff --git a/third_party/WebKit/LayoutTests/media/video-aspect-ratio.html b/third_party/WebKit/LayoutTests/media/video-aspect-ratio.html index 657b4fb..ffd95a9 100644 --- a/third_party/WebKit/LayoutTests/media/video-aspect-ratio.html +++ b/third_party/WebKit/LayoutTests/media/video-aspect-ratio.html
@@ -1,6 +1,6 @@ <script src="media-file.js"></script> <script src="video-paint-test.js"></script> -<body onload="setSrcByTagName('video', 'content/test.ogv'); init()"> +<body onload="setSrcByTagName('video', findMediaFile('video', 'content/test')); init()"> <p>Test video sizing. You should see one bigger image (paused video) and 7 small ones of 1/4 its size. </p> <video></video><br> <video style="width: 160px; height:120px">
diff --git a/third_party/WebKit/LayoutTests/media/video-autoplay.html b/third_party/WebKit/LayoutTests/media/video-autoplay.html index 3f1bf06..5d3d8ff 100644 --- a/third_party/WebKit/LayoutTests/media/video-autoplay.html +++ b/third_party/WebKit/LayoutTests/media/video-autoplay.html
@@ -2,6 +2,7 @@ <title>Verify that "autoplay" attribute on a media element starts playback automatically.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video autoplay></video> <script> async_test(function(t) { @@ -13,6 +14,6 @@ assert_false(video.paused); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html index a6db6f38..2ae28aa 100644 --- a/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html +++ b/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html
@@ -2,6 +2,7 @@ <title>Test that video media documents have a black background.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <iframe></iframe> <script> async_test(function(t) { @@ -14,6 +15,6 @@ assert_equals(iframeBodyStyle.backgroundColor, "rgb(0, 0, 0)"); }); - iframe.src = "content/counting.ogv"; + iframe.src = findMediaFile("video", "content/counting"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html b/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html index 3cbce76..8271244 100644 --- a/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html +++ b/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html
@@ -2,6 +2,7 @@ <title>Load a video with an infinite duration. Start playback and ensure video.currentTime is less than video.buffered.end(0) upon first timeupdate.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) {
diff --git a/third_party/WebKit/LayoutTests/media/video-buffered.html b/third_party/WebKit/LayoutTests/media/video-buffered.html index 645dab5..b7b6070 100644 --- a/third_party/WebKit/LayoutTests/media/video-buffered.html +++ b/third_party/WebKit/LayoutTests/media/video-buffered.html
@@ -2,6 +2,7 @@ <title>Test video buffering properties.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -23,6 +24,6 @@ assert_throws("IndexSizeError", function() { video.buffered.end(1); }); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas-alpha.html b/third_party/WebKit/LayoutTests/media/video-canvas-alpha.html index 82c438b..9ee14545 100644 --- a/third_party/WebKit/LayoutTests/media/video-canvas-alpha.html +++ b/third_party/WebKit/LayoutTests/media/video-canvas-alpha.html
@@ -1,5 +1,6 @@ <html> <head> + <script src="media-file.js"></script> <script> if (window.testRunner) { @@ -8,8 +9,8 @@ function onLoad() { video = document.getElementsByTagName('video')[0]; - video.src = "content/test.ogv"; - + video.src = findMediaFile("video", "content/test"); + canvas = document.getElementsByTagName('canvas')[0]; ctx = canvas.getContext('2d'); @@ -21,7 +22,7 @@ if (window.testRunner) { testRunner.notifyDone(); } - }); + }); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas-draw-expected.html b/third_party/WebKit/LayoutTests/media/video-canvas-draw-expected.html index 4f0d5da6..0f9f145 100644 --- a/third_party/WebKit/LayoutTests/media/video-canvas-draw-expected.html +++ b/third_party/WebKit/LayoutTests/media/video-canvas-draw-expected.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <html> <head> +<script src="media-file.js"></script> <script> if (window.testRunner) { @@ -20,16 +21,16 @@ var video1 = document.getElementById('video1'); var video2 = document.getElementById('video2'); var video3 = document.getElementById('video3'); - video1.src = "content/test.ogv"; + video1.src = findMediaFile("video", "content/test"); video2.src = video1.src; video3.src = video1.src; video1.load(); video2.load(); video3.load(); - video1.addEventListener("canplay", onVideoLoaded); - video2.addEventListener("canplay", onVideoLoaded); - video3.addEventListener("canplay", onVideoLoaded); + video1.addEventListener("canplay", onVideoLoaded); + video2.addEventListener("canplay", onVideoLoaded); + video3.addEventListener("canplay", onVideoLoaded); } </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas-draw.html b/third_party/WebKit/LayoutTests/media/video-canvas-draw.html index 8dc445b..1bf7227d 100644 --- a/third_party/WebKit/LayoutTests/media/video-canvas-draw.html +++ b/third_party/WebKit/LayoutTests/media/video-canvas-draw.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <html> <head> +<script src="media-file.js"></script> <script> if (window.testRunner) { @@ -9,7 +10,7 @@ function onLoad() { var video = document.getElementsByTagName('video')[0]; - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); var canvas1 = document.getElementById('canvas1'); var canvas2 = document.getElementById('canvas2'); @@ -26,7 +27,7 @@ if (window.testRunner) { testRunner.notifyDone(); } - }); + }); } </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas-source.html b/third_party/WebKit/LayoutTests/media/video-canvas-source.html index c8bc4c8f..0832004 100644 --- a/third_party/WebKit/LayoutTests/media/video-canvas-source.html +++ b/third_party/WebKit/LayoutTests/media/video-canvas-source.html
@@ -2,6 +2,7 @@ <title>Verify that drawing to canvas using video with source element does not taint canvas</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <canvas></canvas> <script> @@ -19,7 +20,7 @@ }); var source = document.createElement("source"); - source.src = "content/counting.ogv"; + source.src = findMediaFile("video", "content/counting"); video.appendChild(source); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas.html b/third_party/WebKit/LayoutTests/media/video-canvas.html index f3b1c88..3a0c2981 100644 --- a/third_party/WebKit/LayoutTests/media/video-canvas.html +++ b/third_party/WebKit/LayoutTests/media/video-canvas.html
@@ -2,6 +2,7 @@ <title>Test "video" as a source for "canvas".</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <canvas width="160" height="120"></canvas> <script> @@ -57,6 +58,6 @@ video.currentTime = results.values[results.current].time; } - video.src = "content/counting.ogv"; + video.src = findMediaFile("video", "content/counting"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-colorspace-yuv420.html b/third_party/WebKit/LayoutTests/media/video-colorspace-yuv420.html index 740f5dc..c19951a 100644 --- a/third_party/WebKit/LayoutTests/media/video-colorspace-yuv420.html +++ b/third_party/WebKit/LayoutTests/media/video-colorspace-yuv420.html
@@ -7,7 +7,7 @@ <p>Test correct colorspace for yuv420, i.e. YU12 video </p> <video/> <script> - setSrcByTagName('video', 'content/test_yuv420.ogv'); + setSrcByTagName('video', findMediaFile('video', 'content/test_yuv420')); init(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/media/video-colorspace-yuv422.html b/third_party/WebKit/LayoutTests/media/video-colorspace-yuv422.html index 3e42c048..1b5bb23 100644 --- a/third_party/WebKit/LayoutTests/media/video-colorspace-yuv422.html +++ b/third_party/WebKit/LayoutTests/media/video-colorspace-yuv422.html
@@ -7,7 +7,7 @@ <p>Test correct colorspace for yuv422, i.e. YU16 video </p> <video/> <script> - setSrcByTagName('video', 'content/test_yuv422.ogv'); + setSrcByTagName('video', findMediaFile('video', 'content/test_yuv422')); init(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html b/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html index 71ea685..5bc07fb 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html
@@ -2,6 +2,7 @@ <title>Verify that media controls are always visible when hovered.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls loop></video> <script> @@ -25,6 +26,6 @@ }), video); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html b/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html index fffbfca..0e9fe94 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html
@@ -2,11 +2,12 @@ <title>Test that the controls attribute is not affected by fullscreen</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.onloadeddata = t.step_func(function() { assert_false(video.controls); video.onwebkitfullscreenchange = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html b/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html index 8f87fe0..3c2c2799 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html
@@ -2,6 +2,7 @@ <title>Test video control element visibility when play by touch.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls loop></video> <script> @@ -32,6 +33,6 @@ }), video); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html b/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html index 41b0b9bf..0b204f0 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <!-- "tabindex" makes the video focusable despite it not having controls --> <video tabindex="0"></video> <script> @@ -17,7 +18,7 @@ }), video); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.play(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-download-button-not-displayed-local.html b/third_party/WebKit/LayoutTests/media/video-controls-download-button-not-displayed-local.html index a356bec0..751ccfb 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-download-button-not-displayed-local.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-download-button-not-displayed-local.html
@@ -3,11 +3,12 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <video controls></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); var controlID = "-internal-media-controls-download-button"; var downloadButton = mediaControlsElement(internals.shadowRoot(video).firstChild, controlID); video.onloadeddata = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html b/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html index 5d858c18..ef9b581 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <video controls></video> <script> async_test(function(t) { @@ -24,6 +25,6 @@ }), video); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-allowed.html b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-allowed.html index 65f641b9..f394b3c 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-allowed.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-allowed.html
@@ -4,7 +4,8 @@ <title>video controls fullscreen button in iframe with allowfullscreen attribute</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> - <script src="media-controls.js"></script> + <script src="media-file.js"></script> + <script src="media-controls.js"></script> <script src="video-controls-fullscreen.js"></script> </head> <body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-not-allowed.html b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-not-allowed.html index 049d9f9..b270d8f6 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-not-allowed.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-not-allowed.html
@@ -4,7 +4,8 @@ <title>video controls fullscreen button in iframe without allowfullscreen attribute</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> - <script src="media-controls.js"></script> + <script src="media-file.js"></script> + <script src="media-controls.js"></script> <script src="video-controls-fullscreen.js"></script> </head> <body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-not-supported.html b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-not-supported.html index 4931e3b..028f7ae 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-not-supported.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-not-supported.html
@@ -4,7 +4,8 @@ <title>video controls fullscreen button with fullscreenSupported setting disabled</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> - <script src="media-controls.js"></script> + <script src="media-file.js"></script> + <script src="media-controls.js"></script> <script src="video-controls-fullscreen.js"></script> </head> <body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.html b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.html index 514894a..38fddf1 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.html
@@ -4,7 +4,8 @@ <title>video controls fullscreen button</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> - <script src="media-controls.js"></script> + <script src="media-file.js"></script> + <script src="media-controls.js"></script> <script src="video-controls-fullscreen.js"></script> </head> <body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.js b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.js index 6cbceaea..5c953fe 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.js +++ b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.js
@@ -7,8 +7,8 @@ var v1 = document.createElement("video"); var v2 = document.createElement("video"); v1.controls = v2.controls = true; - v1.src = "content/test.ogv"; - v2.src = "content/test.oga"; + v1.src = findMediaFile("video", "content/test"); + v2.src = findMediaFile("audio", "content/test"); document.body.appendChild(v1); document.body.appendChild(v2); @@ -41,7 +41,7 @@ var doc = iframe.contentDocument; var v = doc.createElement("video"); v.controls = true; - v.src = "content/test.ogv"; + v.src = findMediaFile("video", "content/test"); doc.body.appendChild(v); v.addEventListener("loadeddata", t.step_func_done(function() @@ -58,7 +58,7 @@ { var v = document.createElement("video"); v.controls = true; - v.src = "content/test.ogv"; + v.src = findMediaFile("video", "content/test"); document.body.appendChild(v); v.addEventListener("loadeddata", t.step_func_done(function()
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html b/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html index e4cc123..5d023ca2 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <video controls></video> <script> async_test(function(t) { @@ -46,6 +47,6 @@ video.muted = true; }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }) </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html b/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html index bb4767d..37c5aeaa 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html
@@ -2,6 +2,7 @@ <title>Test video controls visibility on touch. After a delay the controls must be hidden.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls loop></video> <script> @@ -24,6 +25,6 @@ }), video); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html b/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html index 386dfa42..aa6c602 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html
@@ -2,6 +2,7 @@ <title>Test video controls visibility when mouse is not over controls.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls loop></video> <script> @@ -27,6 +28,6 @@ eventSender.mouseMoveTo(video.offsetLeft + 4, video.offsetTop + 4); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html index 1386a2e5..05b878d 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html
@@ -2,6 +2,7 @@ <title>Test that controls don't increase the size of the container (i.e. are rendered overlapping with the video canvas).</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <iframe style="width: 400px; height: 300px; border: 0px;"></iframe> <script> async_test(function(t) { @@ -16,6 +17,6 @@ }); }); - iframe.src = "content/test.ogv"; + iframe.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-labels.html b/third_party/WebKit/LayoutTests/media/video-controls-labels.html index 7ef52c8..697eae15 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-labels.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-labels.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <video controls> <track kind="subtitles" src="captions.vtt" srclang="is" label="Icelandic"> <track kind="subtitles" src="captions-fast.vtt" srclang="fr" label=""> @@ -25,6 +26,6 @@ assert_equals(captionsList.children[3].innerText, "Track 3"); }); - video.src = "content/counting.ogv"; + video.src = findMediaFile("video", "content/counting"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html b/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html index bd8a817..052b988 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html
@@ -2,6 +2,7 @@ <title>This tests that a mouse/keyboard event on the controls will not be seen by the video element.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls></video> <script> @@ -61,6 +62,6 @@ eventSender.keyDown('A'); } - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html b/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html index db29c9ac..c12fe6e3 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html
@@ -2,6 +2,7 @@ <title>Test that muted video has an unmute button.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls></video> <script> @@ -16,6 +17,6 @@ assert_not_equals(getComputedStyle(muteButton).display, "none"); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html index f1c3212..fff2b17 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <script src="overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video. var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.setAttribute("width", "60"); // Add two captions. video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-list-hide-on-click-outside.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-list-hide-on-click-outside.html index 06f75c2..34f0b45 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-list-hide-on-click-outside.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-list-hide-on-click-outside.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <script src="overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.setAttribute("width", "60"); // Add captions var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-fullscreen-button.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-fullscreen-button.html index 9969bcf..30fccc1 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-fullscreen-button.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-fullscreen-button.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <script src="overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.setAttribute("width", "60"); window.addEventListener("load", t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-last-button-visible.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-last-button-visible.html index 114a784c..4446dc1 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-last-button-visible.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-last-button-visible.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <script src="overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -13,10 +14,10 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); var audio = document.querySelector("audio"); - audio.src = "content/test.oga"; + audio.src = findMediaFile("audio", "content/test"); video.onloadeddata = t.step_func_done(function() { var overflowVideo = getOverflowMenuButton(video);
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-mute-button.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-mute-button.html index e0e2e41..9ce5a68 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-mute-button.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-mute-button.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <script src="overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.setAttribute("width", "60"); video.onloadeddata = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-play-button.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-play-button.html index 874d194..07a0562 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-play-button.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-play-button.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <script src="overflow-menu.js"></script> <!--Padding ensures the overflow menu is visible for the tests. --> @@ -12,7 +13,7 @@ async_test(function(t) { // Set up video var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.setAttribute("width", "60"); video.onloadeddata = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-rendering.html b/third_party/WebKit/LayoutTests/media/video-controls-rendering.html index 9f0273a..d9b7aee 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-rendering.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-rendering.html
@@ -15,6 +15,6 @@ if (window.internals) window.internals.settings.setMockScrollbarsEnabled(true); init(); -setSrcByTagName('video', 'content/test.ogv'); +setSrcByTagName('video', findMediaFile('video', 'content/test')); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html b/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html index 39efcff..2e7f025 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html
@@ -2,6 +2,7 @@ <title>Test visibiblity of controls when focusing video.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls autoplay></video> <script> @@ -21,6 +22,6 @@ }), video); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-toggling.html b/third_party/WebKit/LayoutTests/media/video-controls-toggling.html index c80f576..98beb5e 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-toggling.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-toggling.html
@@ -2,6 +2,7 @@ <title>Test rendering of volume slider of video tag.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls></video> <script> @@ -13,7 +14,7 @@ video.onplay = t.step_func(function() { panel = mediaControlsButton(video, "panel"); muteButtonCoordinates = mediaControlsButtonCoordinates(video, "mute-button"); - + // Move mouse somewhere over the panel. eventSender.mouseMoveTo(muteButtonCoordinates[0], muteButtonCoordinates[1]); @@ -42,7 +43,7 @@ t.done(); } - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.play(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html b/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html index 2f7f0f7..cd1b40b 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html
@@ -2,6 +2,7 @@ <title>Test that touch events on the controls will not be seen by the video element.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls></video> <script> @@ -42,6 +43,6 @@ eventSender.cancelTouchPoint(0); } - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-track-selection-menu.html b/third_party/WebKit/LayoutTests/media/video-controls-track-selection-menu.html index 3139ff1..989249c 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-track-selection-menu.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-track-selection-menu.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="track/track-helpers.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <!-- Width should be large enough to display closed captions button. --> <video controls style="width: 500px"> @@ -44,7 +45,7 @@ assert_equals(textTrackDisplayElement(video).innerText, "first caption"); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); } }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-transformed.html b/third_party/WebKit/LayoutTests/media/video-controls-transformed.html index b70ac0a..b579419 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-transformed.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-transformed.html
@@ -2,6 +2,7 @@ <title>Test "controls" on transformed video.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <style> video { @@ -24,6 +25,6 @@ assert_false(video.paused); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html index e2abfcd..a762090 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html
@@ -2,6 +2,7 @@ <title>Test video controls visibility with multimodal input. The controls should remain visible if the last input event was a mouse move over them.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls loop></video> <script> @@ -23,7 +24,7 @@ // And then hover the control with the mouse. eventSender.mouseMoveTo(0, 0); eventSender.mouseMoveTo(coords[0], coords[1]); - + // And the controls should remain visible. runAfterHideMediaControlsTimerFired(t.step_func_done(function() { assert_true(isControlsPanelVisible(video)); @@ -31,6 +32,6 @@ }), video); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html index 7ccc2e47..c578b4e 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html
@@ -2,6 +2,7 @@ <title>Test video controls visibility with multimodal input. The controls should hide after a timeout if the last input event was a tap.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <video controls loop></video> <script> @@ -35,6 +36,6 @@ }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-visible-audio-only.html b/third_party/WebKit/LayoutTests/media/video-controls-visible-audio-only.html index 2bb7834ff..a267a38 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-visible-audio-only.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-visible-audio-only.html
@@ -2,7 +2,7 @@ <html> <head> <style> - #no-video-media { background-color: yellow; width: 320px; height: 100px;} + #no-video-media { background-color: yellow; width: 320px; height: 100px;} #mouse-parking:hover { padding:8; background-color: blue; } </style> <script src=media-file.js></script> @@ -20,15 +20,15 @@ var console = document.getElementById("console"); console.innerHTML += text + "<br>"; } - + function testcondition(testFuncString, endit) { if (eval(testFuncString)) consoleWrite("TEST(" + testFuncString + ") <span style='color:green'>OK</span>"); else - consoleWrite("TEST(" + testFuncString + ") <span style='color:red'>FAIL</span>"); + consoleWrite("TEST(" + testFuncString + ") <span style='color:red'>FAIL</span>"); } - + function start() { video = document.getElementById("no-video-media"); @@ -62,8 +62,8 @@ } if (window.testRunner) { - setTimeout(function() { - document.body.appendChild(document.createTextNode('FAIL')); + setTimeout(function() { + document.body.appendChild(document.createTextNode('FAIL')); if (window.testRunner) testRunner.notifyDone(); } , 8000); @@ -81,7 +81,7 @@ <video id="no-video-media" controls loop oncanplaythrough="start()"></video> <br><br><div id="console"></div> <script> - setSrcById("no-video-media", "content/test.oga"); + setSrcById("no-video-media", findMediaFile("audio", "content/test")); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html b/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html index d76b9ce..b831b91 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html +++ b/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html
@@ -2,6 +2,7 @@ <title>Test controls with zooming.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="media-controls.js"></script> <style> video { @@ -34,6 +35,6 @@ }, 50); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls.html b/third_party/WebKit/LayoutTests/media/video-controls.html index 75dd19e..c2c26a73 100644 --- a/third_party/WebKit/LayoutTests/media/video-controls.html +++ b/third_party/WebKit/LayoutTests/media/video-controls.html
@@ -2,6 +2,7 @@ <title>Test "controls" attribute.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video controls></video> <script> async_test(function(t) { @@ -20,6 +21,6 @@ assert_true(video.controls); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html index 5574eaa..453517d 100644 --- a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html +++ b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html
@@ -2,11 +2,12 @@ <title>Test currentTime values when setting while readystate is HAVE_NOTHING for media fragment URI.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv" + "#t=2"; + video.src = findMediaFile("video", "content/test") + "#t=2"; assert_equals(video.currentTime, 0); video.currentTime = 1;
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html index 5c9978b..4bea570 100644 --- a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html +++ b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html
@@ -2,11 +2,12 @@ <title>Test currentTime values when setting while readystate is HAVE_NOTHING.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); assert_equals(video.currentTime, 0); video.currentTime = 1; assert_equals(video.currentTime, 1);
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html b/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html index 4ae1630..be0fff4 100644 --- a/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html +++ b/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html
@@ -2,6 +2,7 @@ <title>Test, a delay in playing the movie still results in an "ended" event.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -20,6 +21,6 @@ }); video.onended = t.step_func_done(); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-set.html b/third_party/WebKit/LayoutTests/media/video-currentTime-set.html index 9ec6ad3..614144b 100644 --- a/third_party/WebKit/LayoutTests/media/video-currentTime-set.html +++ b/third_party/WebKit/LayoutTests/media/video-currentTime-set.html
@@ -2,6 +2,7 @@ <title>Test that setting currentTime changes the time, and that "ended" event is fired in a reasonable amount of time.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -19,6 +20,6 @@ video.play(); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html b/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html index 53b46cc4..350c058 100644 --- a/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html +++ b/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html
@@ -2,6 +2,7 @@ <title>Test that setting currentTime changes the time, and setting invalid values throw exceptions.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -18,6 +19,6 @@ assert_equals(video.currentTime, 3.1); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime.html b/third_party/WebKit/LayoutTests/media/video-currentTime.html index dbd5abc0..b8b190c9 100644 --- a/third_party/WebKit/LayoutTests/media/video-currentTime.html +++ b/third_party/WebKit/LayoutTests/media/video-currentTime.html
@@ -2,6 +2,7 @@ <title>Test media current time values.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -17,6 +18,6 @@ }), 500); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-defaultmuted.html b/third_party/WebKit/LayoutTests/media/video-defaultmuted.html index d8b47c0..db62a01 100644 --- a/third_party/WebKit/LayoutTests/media/video-defaultmuted.html +++ b/third_party/WebKit/LayoutTests/media/video-defaultmuted.html
@@ -2,6 +2,7 @@ <title>Test "defaultMuted" IDL, "muted" IDL and content attributes.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> test(function() { var video = document.createElement("video"); @@ -31,6 +32,6 @@ assert_false(video.muted); }); - video.src = "content/test.oga"; + video.src = findMediaFile("audio", "content/test"); }, "Test 'muted' content and IDL attributes on video load"); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-delay-load-event.html b/third_party/WebKit/LayoutTests/media/video-delay-load-event.html index 5064289..3592227 100644 --- a/third_party/WebKit/LayoutTests/media/video-delay-load-event.html +++ b/third_party/WebKit/LayoutTests/media/video-delay-load-event.html
@@ -2,6 +2,7 @@ <title>Test that the document's load event is delayed until a video's meta data is available.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video id="video1"></video> <video id="video2"></video> <video id="video3"><source></source></video> @@ -10,11 +11,11 @@ assertVideoNoSrcNoLoad(document.getElementById("video1")); var video = document.getElementById("video2"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); assertVideoSrcNoLoad(video); var source = document.querySelector("source"); - source.src = "content/test.ogv"; + source.src = findMediaFile("video", "content/test"); assertVideoSrcNoLoad(document.getElementById("video3")); window.onload = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html b/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html index 3fe516e..96d91ef 100644 --- a/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html +++ b/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html
@@ -2,6 +2,7 @@ <title>Test video dimension aspect ratio.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -14,6 +15,6 @@ assert_equals(video.videoHeight, 240); }); - video.src = "content/test-par-16-9.ogv"; + video.src = findMediaFile("video", "content/test-par-16-9"); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-display-none-crash.html b/third_party/WebKit/LayoutTests/media/video-display-none-crash.html index eee208f..67812acc 100644 --- a/third_party/WebKit/LayoutTests/media/video-display-none-crash.html +++ b/third_party/WebKit/LayoutTests/media/video-display-none-crash.html
@@ -2,11 +2,12 @@ <title>Test that pause() after changing display to "none" doesn't cause a crash.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> test(function() { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.play(); video.style.display = "none"; video.pause();
diff --git a/third_party/WebKit/LayoutTests/media/video-display-toggle.html b/third_party/WebKit/LayoutTests/media/video-display-toggle.html index 56c577a..83aae36 100644 --- a/third_party/WebKit/LayoutTests/media/video-display-toggle.html +++ b/third_party/WebKit/LayoutTests/media/video-display-toggle.html
@@ -16,7 +16,7 @@ { if (window.testRunner) testRunner.waitUntilDone(); - setSrcById('vid', 'content/test.ogv'); + setSrcById('vid', findMediaFile('video', 'content/test')); var video = document.getElementById('vid'); video.addEventListener("canplaythrough", test2); video.load();
diff --git a/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html b/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html index 991eaaa..8aaf56e2 100644 --- a/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html +++ b/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html
@@ -2,6 +2,7 @@ <title>Test media "autoplay" attribute set via DOM.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -15,6 +16,6 @@ assert_false(video.paused); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-dom-src.html b/third_party/WebKit/LayoutTests/media/video-dom-src.html index 47c6877..e214ce6 100644 --- a/third_party/WebKit/LayoutTests/media/video-dom-src.html +++ b/third_party/WebKit/LayoutTests/media/video-dom-src.html
@@ -2,12 +2,13 @@ <title>Test media "src" attribute set via DOM.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); assert_equals(video.currentSrc, ""); - var mediaFile = "content/test.ogv"; + var mediaFile = findMediaFile("video", "content/test"); video.src = mediaFile; assert_equals(video.currentSrc, "");
diff --git a/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html b/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html index 612d148..fe5e533 100644 --- a/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html +++ b/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html
@@ -2,6 +2,7 @@ <title>Test double seek currentTime.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> // Seek to same time twice and make sure "seeking" is fired twice and that @@ -26,6 +27,6 @@ assert_equals(video.currentTime, timeToTest); })); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html b/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html index 296a1b2..a1c3fac 100644 --- a/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html +++ b/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html
@@ -2,6 +2,7 @@ <title>Tests that duration is known after playback ended.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -16,7 +17,7 @@ video.currentTime = video.duration - 0.2; }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.play(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html b/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html index 4e255a4a..b6cd9a4f 100644 --- a/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html +++ b/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html
@@ -2,6 +2,7 @@ <title>Test webkitRequestFullscreen() without any user gesture.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -14,6 +15,6 @@ video.onwebkitfullscreenerror = t.step_func_done(); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-error-networkState.html b/third_party/WebKit/LayoutTests/media/video-error-networkState.html index be5a43d..535e2eff 100644 --- a/third_party/WebKit/LayoutTests/media/video-error-networkState.html +++ b/third_party/WebKit/LayoutTests/media/video-error-networkState.html
@@ -2,6 +2,7 @@ <title>Test media element networkState value in an error corner case.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -27,7 +28,7 @@ }), 0); }); - video.src = "content/corrupt.ogv"; + video.src = findMediaFile("video", "content/corrupt"); video.play(); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-load.html b/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-load.html index 2b5392b..c7b1a376 100644 --- a/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-load.html +++ b/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-load.html
@@ -2,11 +2,12 @@ <title>Test that loading a video element with preload "none" changes its effective preload to "metadata"</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video preload="none"></video> <script> test(function() { var video = document.querySelector('video'); - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); assert_equals(internals.effectivePreload(video), "none"); video.load(); assert_equals(internals.effectivePreload(video), "metadata");
diff --git a/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-play.html b/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-play.html index e35facd..1b494fe 100644 --- a/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-play.html +++ b/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-play.html
@@ -2,11 +2,12 @@ <title>Test that playing a video element with preload "none" changes its effective preload to "metadata"</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video preload="none"></video> <script> test(function() { var video = document.querySelector('video'); - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); assert_equals(internals.effectivePreload(video), "none"); video.play(); assert_equals(internals.effectivePreload(video), "metadata");
diff --git a/third_party/WebKit/LayoutTests/media/video-frame-accurate-seek.html b/third_party/WebKit/LayoutTests/media/video-frame-accurate-seek.html index 25ecf93..a92a866 100644 --- a/third_party/WebKit/LayoutTests/media/video-frame-accurate-seek.html +++ b/third_party/WebKit/LayoutTests/media/video-frame-accurate-seek.html
@@ -4,7 +4,7 @@ <script src="media-file.js"></script> <script src="video-paint-test.js"></script> </head> - <body onload="setSrcByTagName('video', 'content/test-25fps.ogv'); initAndSeeked()"> + <body onload="setSrcByTagName('video', findMediaFile('video', 'content/test-25fps')); initAndSeeked()"> <p>Test that setting currentTime is frame-accurate. The three videos below should be showing frames 12, 13, and 14.</p> <video oncanplaythrough='event.target.currentTime=(12/25)'></video> <video oncanplaythrough='event.target.currentTime=(13/25)'></video>
diff --git a/third_party/WebKit/LayoutTests/media/video-layer-crash.html b/third_party/WebKit/LayoutTests/media/video-layer-crash.html index 96373a9..1c2cc22 100644 --- a/third_party/WebKit/LayoutTests/media/video-layer-crash.html +++ b/third_party/WebKit/LayoutTests/media/video-layer-crash.html
@@ -12,7 +12,7 @@ <video style="transform:scale(0.5)"></video><br> <video style="transform:skew(20deg)"></video><br> <script> - setSrcByTagName('video', 'content/test.ogv'); + setSrcByTagName('video', findMediaFile('video', 'content/test')); document.body.removeChild(document.getElementById('one')); document.body.offsetLeft; init(); </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-load-networkState.html b/third_party/WebKit/LayoutTests/media/video-load-networkState.html index b26125dc..e4175ed 100644 --- a/third_party/WebKit/LayoutTests/media/video-load-networkState.html +++ b/third_party/WebKit/LayoutTests/media/video-load-networkState.html
@@ -2,6 +2,7 @@ <title>Test that setting src to an invalid url triggers load(), which sets networkState to NETWORK_NO_SOURCE. Setting src to a valid url should then trigger the loading events and end up with networkState >= NETWORK_LOADING.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -16,7 +17,7 @@ video.onerror = t.step_func(function() { assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE); // now set a valid url - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); video.oncanplaythrough = t.step_func_done(function () {
diff --git a/third_party/WebKit/LayoutTests/media/video-load-preload-none.html b/third_party/WebKit/LayoutTests/media/video-load-preload-none.html index e7ed897..bc789b3 100644 --- a/third_party/WebKit/LayoutTests/media/video-load-preload-none.html +++ b/third_party/WebKit/LayoutTests/media/video-load-preload-none.html
@@ -2,6 +2,7 @@ <title>Test that an explicit load() to a media element whose preload is set to "none" still loads the video.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video preload="none"></video> <script> async_test(function(t) { @@ -19,6 +20,6 @@ video.load(); }, 300); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-load-readyState.html b/third_party/WebKit/LayoutTests/media/video-load-readyState.html index 4e6cc93e..56b6b11 100644 --- a/third_party/WebKit/LayoutTests/media/video-load-readyState.html +++ b/third_party/WebKit/LayoutTests/media/video-load-readyState.html
@@ -2,6 +2,7 @@ <title>Test media element readystate value on load.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -18,6 +19,6 @@ assert_equals(video.readyState, HTMLMediaElement.HAVE_ENOUGH_DATA); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html b/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html index b225846d..a441d48 100644 --- a/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html +++ b/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html
@@ -2,6 +2,7 @@ <title>Test looping edge case to verify http://crbug.com/364442.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> // Seek towards end of video (for faster testing). @@ -49,6 +50,6 @@ video.play(); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-loop.html b/third_party/WebKit/LayoutTests/media/video-loop.html index 09ba701..4aee3df 100644 --- a/third_party/WebKit/LayoutTests/media/video-loop.html +++ b/third_party/WebKit/LayoutTests/media/video-loop.html
@@ -2,6 +2,7 @@ <title>Test video looping.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video autoplay></video> <script> // Test looping by: @@ -67,6 +68,6 @@ // Set "loop" to true and begin playing. video.loop = true; - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-move-to-new-document-crash.html b/third_party/WebKit/LayoutTests/media/video-move-to-new-document-crash.html index 6476448..cba59dc1 100644 --- a/third_party/WebKit/LayoutTests/media/video-move-to-new-document-crash.html +++ b/third_party/WebKit/LayoutTests/media/video-move-to-new-document-crash.html
@@ -2,10 +2,11 @@ <title>Test that moving video element to a new document and performing an operation on it doesn't crash.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> async_test(function(t) { var v = document.createElement('video'); - v.src = 'content/test.ogv'; + v.src = findMediaFile('video', 'content/test'); v.oncanplaythrough = t.step_func(function() { var newDoc = document.implementation.createDocument( "", null); newDoc.adoptNode(v);
diff --git a/third_party/WebKit/LayoutTests/media/video-move-to-new-document-srcobject.html b/third_party/WebKit/LayoutTests/media/video-move-to-new-document-srcobject.html index 361e0458..9bb762f 100644 --- a/third_party/WebKit/LayoutTests/media/video-move-to-new-document-srcobject.html +++ b/third_party/WebKit/LayoutTests/media/video-move-to-new-document-srcobject.html
@@ -2,6 +2,7 @@ <title>Verify that moving a video element to a new document, still loads it normally</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <iframe></iframe> <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html b/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html index 18bbd24..139f701 100644 --- a/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html +++ b/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html
@@ -2,12 +2,13 @@ <title>Verify that moving a video element to a new document, still loads it normally</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <iframe></iframe> <script> async_test(function(t) { var video = document.querySelector('video'); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.onloadeddata = this.step_func(function() { video.onloadeddata = null; assert_true(video.networkState == video.NETWORK_IDLE || video.networkState == video.NETWORK_LOADING);
diff --git a/third_party/WebKit/LayoutTests/media/video-muted.html b/third_party/WebKit/LayoutTests/media/video-muted.html index 965a8ae2..07d4247 100644 --- a/third_party/WebKit/LayoutTests/media/video-muted.html +++ b/third_party/WebKit/LayoutTests/media/video-muted.html
@@ -2,6 +2,7 @@ <title>Test "muted" attribute.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -16,6 +17,6 @@ assert_false(video.muted); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-no-audio.html b/third_party/WebKit/LayoutTests/media/video-no-audio.html index 209746e..22586257 100644 --- a/third_party/WebKit/LayoutTests/media/video-no-audio.html +++ b/third_party/WebKit/LayoutTests/media/video-no-audio.html
@@ -4,10 +4,10 @@ <script> if (window.testRunner) testRunner.waitUntilDone(); - + function start() { - setSrcByTagName("video", "content/counting.ogv"); + setSrcByTagName("video", findMediaFile("video", "content/counting")); } function finish()
diff --git a/third_party/WebKit/LayoutTests/media/video-no-autoplay.html b/third_party/WebKit/LayoutTests/media/video-no-autoplay.html index 867fdd2..d10b5cc 100644 --- a/third_party/WebKit/LayoutTests/media/video-no-autoplay.html +++ b/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
@@ -2,6 +2,7 @@ <title>Test that play event does not fire when "src" set with no autoplay attribute.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -16,6 +17,6 @@ }), 500); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-no-controls-events-not-absorbed.html b/third_party/WebKit/LayoutTests/media/video-no-controls-events-not-absorbed.html index 2219bb3..13bdfc8d 100644 --- a/third_party/WebKit/LayoutTests/media/video-no-controls-events-not-absorbed.html +++ b/third_party/WebKit/LayoutTests/media/video-no-controls-events-not-absorbed.html
@@ -2,6 +2,7 @@ <title>Video elements without controls should not absborb click events</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> test(_ => { @@ -21,6 +22,6 @@ t.done(); })); - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html b/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html index 4974a9d8..3f0b2c5 100644 --- a/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html +++ b/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html
@@ -2,6 +2,7 @@ <title>Test that no timeupdate event fires during loading.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -17,6 +18,6 @@ }); video.ontimeupdate = t.unreached_func(); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-object-fit-change-expected.html b/third_party/WebKit/LayoutTests/media/video-object-fit-change-expected.html index c016b30..0fedd32 100644 --- a/third_party/WebKit/LayoutTests/media/video-object-fit-change-expected.html +++ b/third_party/WebKit/LayoutTests/media/video-object-fit-change-expected.html
@@ -18,7 +18,7 @@ function init() { - setSrcByTagName("video", "content/test.ogv"); + setSrcByTagName("video", findMediaFile("video", "content/test")); var totalCount = document.getElementsByTagName('video').length; var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/video-object-fit-change.html b/third_party/WebKit/LayoutTests/media/video-object-fit-change.html index 0306d91..428e11f6 100644 --- a/third_party/WebKit/LayoutTests/media/video-object-fit-change.html +++ b/third_party/WebKit/LayoutTests/media/video-object-fit-change.html
@@ -18,7 +18,7 @@ function init() { - setSrcByTagName("video", "content/test.ogv"); + setSrcByTagName("video", findMediaFile("video", "content/test")); var totalCount = document.getElementsByTagName('video').length; var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/video-object-fit-expected.html b/third_party/WebKit/LayoutTests/media/video-object-fit-expected.html index b7fc684..8337ef4b 100644 --- a/third_party/WebKit/LayoutTests/media/video-object-fit-expected.html +++ b/third_party/WebKit/LayoutTests/media/video-object-fit-expected.html
@@ -27,7 +27,7 @@ function init() { - setSrcByTagName("video", "content/test.ogv"); + setSrcByTagName("video", findMediaFile("video", "content/test")); var totalCount = document.getElementsByTagName('video').length; var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/video-object-fit.html b/third_party/WebKit/LayoutTests/media/video-object-fit.html index 1b2cd49..67ad4d0f 100644 --- a/third_party/WebKit/LayoutTests/media/video-object-fit.html +++ b/third_party/WebKit/LayoutTests/media/video-object-fit.html
@@ -18,7 +18,7 @@ function init() { - setSrcByTagName("video", "content/test.ogv"); + setSrcByTagName("video", findMediaFile("video", "content/test")); var totalCount = document.getElementsByTagName('video').length; var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html b/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html index b95abc6..43bec2e 100644 --- a/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html +++ b/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html
@@ -2,11 +2,12 @@ <title>Test that pause() from EMPTY network state triggers load().</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE); video.onloadstart = t.step_func(function() {});
diff --git a/third_party/WebKit/LayoutTests/media/video-pause-immediately.html b/third_party/WebKit/LayoutTests/media/video-pause-immediately.html index 9734c8b..ca82c4c 100644 --- a/third_party/WebKit/LayoutTests/media/video-pause-immediately.html +++ b/third_party/WebKit/LayoutTests/media/video-pause-immediately.html
@@ -2,12 +2,13 @@ <title>Test that pausing the media element has an immediate effect on the clock.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var timeAfterPause; var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.oncanplay = t.step_func(function() { video.play(); });
diff --git a/third_party/WebKit/LayoutTests/media/video-persistence-expected.html b/third_party/WebKit/LayoutTests/media/video-persistence-expected.html index 6d52a37..a6b60ca9 100644 --- a/third_party/WebKit/LayoutTests/media/video-persistence-expected.html +++ b/third_party/WebKit/LayoutTests/media/video-persistence-expected.html
@@ -29,6 +29,7 @@ } </style> +<script src='media-file.js'></script> <div id='player'> <div id='container'> <video></video> @@ -37,7 +38,7 @@ <div id='fs'>fullscreen</div> <script> var video = document.querySelector('video'); - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); document.querySelector('#fs').addEventListener('click', e => { document.querySelector('#player').webkitRequestFullscreen();
diff --git a/third_party/WebKit/LayoutTests/media/video-persistence.html b/third_party/WebKit/LayoutTests/media/video-persistence.html index a9112eb..2b13a5a2 100644 --- a/third_party/WebKit/LayoutTests/media/video-persistence.html +++ b/third_party/WebKit/LayoutTests/media/video-persistence.html
@@ -20,6 +20,7 @@ } </style> +<script src='media-file.js'></script> <div id='player'> <div id='container'> <video></video> @@ -31,7 +32,7 @@ <div id='fs'>fullscreen</div> <script> var video = document.querySelector('video'); - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); document.querySelector('#fs').addEventListener('click', e => { document.querySelector('#player').webkitRequestFullscreen();
diff --git a/third_party/WebKit/LayoutTests/media/video-play-empty-events.html b/third_party/WebKit/LayoutTests/media/video-play-empty-events.html index 109e3eb..f761aa7 100644 --- a/third_party/WebKit/LayoutTests/media/video-play-empty-events.html +++ b/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
@@ -2,6 +2,7 @@ <title>Test that play() from EMPTY network state triggers load() and async playing event.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -21,7 +22,7 @@ assert_false(video.paused); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.play(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-play-pause-events.html b/third_party/WebKit/LayoutTests/media/video-play-pause-events.html index 8e586461..1bc3c2e 100644 --- a/third_party/WebKit/LayoutTests/media/video-play-pause-events.html +++ b/third_party/WebKit/LayoutTests/media/video-play-pause-events.html
@@ -2,6 +2,7 @@ <title>Test that calling play() and pause() triggers async play, timeupdate and pause events.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -30,7 +31,7 @@ assert_true(video.paused); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.play(); video.pause(); });
diff --git a/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture-expected.txt b/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture-expected.txt index e96aad1..2ae6bba 100644 --- a/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture-expected.txt +++ b/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE ERROR: line 17: Uncaught (in promise) NotAllowedError: play() can only be initiated by a user gesture. +CONSOLE ERROR: line 18: Uncaught (in promise) NotAllowedError: play() can only be initiated by a user gesture. This is a testharness.js-based test. Harness Error. harness_status.status = 1 , harness_status.message = play() can only be initiated by a user gesture. PASS Test that video play does not work unless a user gesture is involved in playing a video.
diff --git a/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html b/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html index 5f91bff6..a2a4b7d 100644 --- a/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html +++ b/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html
@@ -3,6 +3,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="media-controls.js"></script> +<script src="media-file.js"></script> <script> internals.settings.setAutoplayPolicy('user-gesture-required'); </script> @@ -34,6 +35,6 @@ assert_true(video.paused); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-playbackrate.html b/third_party/WebKit/LayoutTests/media/video-playbackrate.html index 922a1a6..8a29a4d 100644 --- a/third_party/WebKit/LayoutTests/media/video-playbackrate.html +++ b/third_party/WebKit/LayoutTests/media/video-playbackrate.html
@@ -2,6 +2,7 @@ <title>Test playbackRate and defaultPlaybackRate.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> // "playbackRate" should not change when play() is called. @@ -26,7 +27,7 @@ assert_equals(video.defaultPlaybackRate, 2); // Test extreme playback rates. - + video.defaultPlaybackRate = Number.MIN_VALUE; assert_equals(video.defaultPlaybackRate, Number.MIN_VALUE); @@ -77,6 +78,6 @@ } }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-played-collapse.html b/third_party/WebKit/LayoutTests/media/video-played-collapse.html index 763c955..426fcb7 100644 --- a/third_party/WebKit/LayoutTests/media/video-played-collapse.html +++ b/third_party/WebKit/LayoutTests/media/video-played-collapse.html
@@ -2,6 +2,7 @@ <title>Test media element's "played" attribute and range collapse.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="video-played.js"></script> <video></video> <script> @@ -62,6 +63,6 @@ waitForPauseAndContinue(t, null, true, expectedStartTimes, expectedEndTimes); } - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html b/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html index 6146bbb..0d300309 100644 --- a/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html +++ b/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html
@@ -2,6 +2,7 @@ <title>Test media element's "played" attribute and ranges.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="video-played.js"></script> <video></video> <script> @@ -52,6 +53,6 @@ waitForPauseAndContinue(t, null, true, expectedStartTimes, expectedEndTimes); } - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-played-reset.html b/third_party/WebKit/LayoutTests/media/video-played-reset.html index ce8bf88..fb426c95f 100644 --- a/third_party/WebKit/LayoutTests/media/video-played-reset.html +++ b/third_party/WebKit/LayoutTests/media/video-played-reset.html
@@ -2,6 +2,7 @@ <title>Test media element's "played" attribute.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script src="video-played.js"></script> <video></video> <script> @@ -25,7 +26,7 @@ timeRangeCount = currentTimeRange = 0; expectedStartTimes = []; expectedEndTimes = []; - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.oncanplay = t.step_func(jumpAndPlayFwd); } @@ -48,6 +49,6 @@ video.onloadstart = t.step_func_done(testRanges(expectedStartTimes, expectedEndTimes)); } - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html b/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html index 8297ca0..a8d2b5a 100644 --- a/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html +++ b/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html
@@ -2,11 +2,12 @@ <p>This test intentionally lets the video keep playing past end of test to ensure that shutdown is clean, since DumpRenderTree used to crash in this case.</p> <video autoplay></video> +<script src="media-file.js"></script> <script> testRunner.dumpAsText(); var video = document.querySelector("video"); video.onplaying = function() { testRunner.notifyDone(); }; -video.src = "content/test.ogv"; +video.src = findMediaFile("video", "content/test"); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-poster-delayed.html b/third_party/WebKit/LayoutTests/media/video-poster-delayed.html index 723418f..9f378b3 100644 --- a/third_party/WebKit/LayoutTests/media/video-poster-delayed.html +++ b/third_party/WebKit/LayoutTests/media/video-poster-delayed.html
@@ -2,6 +2,7 @@ <title>Delayed load of poster should not overwrite intrinsic size of video.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -22,6 +23,6 @@ assert_equals(video.videoHeight, 240); } - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html b/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html index f139b58..8a72eb9 100644 --- a/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html +++ b/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html
@@ -2,13 +2,14 @@ <title>Test HTMLVideoElement's prefixed fullscreen API.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); assert_true(video.webkitSupportsFullscreen); assert_false(video.webkitDisplayingFullscreen); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.onloadeddata = t.step_func(function() { assert_true(video.webkitSupportsFullscreen);
diff --git a/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html b/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html index be8fef5..5b7bde9 100644 --- a/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html +++ b/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html
@@ -2,12 +2,13 @@ <title>Test that a media element with "preload=none" doesn't fire a "stalled" event.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video preload="none"></video> <script> async_test(function(t) { var video = document.querySelector("video"); video.onsuspend = t.step_func_done(); video.onstalled = t.unreached_func(); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-preload-none-to-metadata-after-load-crash.html b/third_party/WebKit/LayoutTests/media/video-preload-none-to-metadata-after-load-crash.html index caa38f4..22fdd44b8 100644 --- a/third_party/WebKit/LayoutTests/media/video-preload-none-to-metadata-after-load-crash.html +++ b/third_party/WebKit/LayoutTests/media/video-preload-none-to-metadata-after-load-crash.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Setting preload=metadata after calling load() w/ preload=none</title> +<script src="media-file.js"></script> <p>PASS if no crash in Debug.</p> <script> if (window.testRunner) @@ -7,7 +8,7 @@ var video = document.createElement('video'); video.preload = "none"; -video.src = 'content/test.ogv'; +video.src = findMediaFile('video', 'content/test'); video.load(); video.preload = "metadata"; </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-preload.html b/third_party/WebKit/LayoutTests/media/video-preload.html index df884904d..8492549 100644 --- a/third_party/WebKit/LayoutTests/media/video-preload.html +++ b/third_party/WebKit/LayoutTests/media/video-preload.html
@@ -2,6 +2,7 @@ <title>Test media loading behaviour with different "preload" values.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <script> var movies = [ // should not buffer, "preload" is "none". @@ -31,7 +32,7 @@ setupAttribute("preload", movie.preload); setupAttribute("autoplay", movie.autoPlay); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); if (movie.hasOwnProperty("play")) video.play();
diff --git a/third_party/WebKit/LayoutTests/media/video-remove-insert-repaints.html b/third_party/WebKit/LayoutTests/media/video-remove-insert-repaints.html index 9b2c0db..9fdae11 100644 --- a/third_party/WebKit/LayoutTests/media/video-remove-insert-repaints.html +++ b/third_party/WebKit/LayoutTests/media/video-remove-insert-repaints.html
@@ -31,7 +31,7 @@ function start() { video = document.getElementsByTagName('video')[0]; - video.src = 'content/test.ogv'; + video.src = findMediaFile('video', 'content/test'); video.addEventListener('canplaythrough', canplaythrough); video.addEventListener('playing', playing); video.addEventListener('seeked', seeked);
diff --git a/third_party/WebKit/LayoutTests/media/video-replaces-poster.html b/third_party/WebKit/LayoutTests/media/video-replaces-poster.html index bf64056..069724d 100644 --- a/third_party/WebKit/LayoutTests/media/video-replaces-poster.html +++ b/third_party/WebKit/LayoutTests/media/video-replaces-poster.html
@@ -1,10 +1,11 @@ <!DOCTYPE html> <title>Test that video frame replaces poster on seeking.</title> +<script src="media-file.js"></script> <script> function doSetup() { // TODO(srirama.m): convert this test to reference test. var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.addEventListener("canplaythrough", function () { video.currentTime = 1; // so the snapshot always has the same frame. });
diff --git a/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html index 1f9da0d..5f0c12e 100644 --- a/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html +++ b/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html
@@ -2,6 +2,7 @@ <title>Test that video(media) documents scale to fit undersized containers.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <iframe style="width: 200px; height: 200px;"></iframe> <script> async_test(function(t) { @@ -17,6 +18,6 @@ video.load(); }); - iframe.src = "content/counting.ogv"; + iframe.src = findMediaFile("video", "content/counting"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html b/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html index c569798..ecd3e79 100644 --- a/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html +++ b/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html
@@ -2,6 +2,7 @@ <title>Test seeking by very small increments.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -33,6 +34,6 @@ video.onplay = t.step_func(function() {}); video.onpause = t.step_func(function() {}); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html b/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html index 06a6faf..50fac62 100644 --- a/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html +++ b/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html
@@ -2,6 +2,7 @@ <title>Test that seeking a paused video past its end sets currentTime to duration and leaves the video paused.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -35,7 +36,7 @@ video.pause(); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.play(); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html b/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html index 3c0c975..29bd0737 100644 --- a/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html +++ b/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html
@@ -2,6 +2,7 @@ <title>Test that seeking video with "loop" past it's end rewinds to the beginning and continues playback.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video loop></video> <script> async_test(function(t) { @@ -34,6 +35,6 @@ } }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html b/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html index 454ebb81..8593285 100644 --- a/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html +++ b/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html
@@ -2,12 +2,13 @@ <title>Test behavior when seeking to the duration and the playback rate equals 0.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.load(); video.onseeking = t.step_func(function() {});
diff --git a/third_party/WebKit/LayoutTests/media/video-seekable.html b/third_party/WebKit/LayoutTests/media/video-seekable.html index 0018dab..0625483 100644 --- a/third_party/WebKit/LayoutTests/media/video-seekable.html +++ b/third_party/WebKit/LayoutTests/media/video-seekable.html
@@ -2,6 +2,7 @@ <title>Test video "seekable" properties.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -23,6 +24,6 @@ assert_throws("IndexSizeError", function() { video.seekable.end(1); }); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-seeking.html b/third_party/WebKit/LayoutTests/media/video-seeking.html index 3218a96..1976f7c1 100644 --- a/third_party/WebKit/LayoutTests/media/video-seeking.html +++ b/third_party/WebKit/LayoutTests/media/video-seeking.html
@@ -2,6 +2,7 @@ <title>Test that seeking attribute is true immediately after a seek, goes back to false when seeking completes, and that a "seeked" event is fired for each seek.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -23,7 +24,7 @@ assert_true(video.seeking); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.currentTime = 0.5; }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html b/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html index 6a272c5..c3f2a93e 100644 --- a/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html +++ b/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html
@@ -2,6 +2,7 @@ <title>Test that setting a non-zero rate causes an async timeupdate event.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -12,7 +13,7 @@ video.playbackRate = 1; }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.playbackRate = 0; video.play(); });
diff --git a/third_party/WebKit/LayoutTests/media/video-single-valid-source.html b/third_party/WebKit/LayoutTests/media/video-single-valid-source.html index 941c8f9..40ee975 100644 --- a/third_party/WebKit/LayoutTests/media/video-single-valid-source.html +++ b/third_party/WebKit/LayoutTests/media/video-single-valid-source.html
@@ -2,6 +2,7 @@ <title>Test that a single valid "source" element loads correctly.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -9,7 +10,7 @@ // The first source should load. var source = document.createElement("source"); - source.src = "content/test.ogv";; + source.src = findMediaFile("video", "content/test");; video.appendChild(source); // The second source is bogus and won't load, but it should never be processed.
diff --git a/third_party/WebKit/LayoutTests/media/video-size.html b/third_party/WebKit/LayoutTests/media/video-size.html index d7ff8f1fc..462bddd 100644 --- a/third_party/WebKit/LayoutTests/media/video-size.html +++ b/third_party/WebKit/LayoutTests/media/video-size.html
@@ -2,6 +2,7 @@ <title>Test "video" element size with and without "src" and "poster" attributes.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <body> <script> var movieInfo = [ @@ -34,7 +35,7 @@ videoHeight: 0 }, { - src: "content/test.ogv", + src: "content/test", poster: "content/abe.png", description: "'poster' and 'src', should be 'video' size", width: 320, @@ -43,7 +44,7 @@ videoHeight: 240 }, { - src: "content/bogus.ogv", + src: "content/bogus", poster: "content/greenbox.png", description: "'poster' and invalid 'src', should be 'poster' size", width: 25, @@ -73,7 +74,7 @@ } if (movie.src) - video.src = movie.src; + video.src = findMediaFile("video", movie.src); if (movie.poster) video.poster = movie.poster;
diff --git a/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html b/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html index 3b004722..eb42abf5 100644 --- a/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html +++ b/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html
@@ -2,6 +2,7 @@ <title>Test adding "source" after removing failed candidate loads media normally.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video> <source></source> </video> @@ -13,7 +14,7 @@ source.onerror = t.step_func(function() { video.removeChild(video.firstChild); var newSource = document.createElement("source"); - newSource.src = "content/test.ogv"; + newSource.src = findMediaFile("video", "content/test"); video.appendChild(newSource); video.onloadedmetadata = t.step_func_done(); });
diff --git a/third_party/WebKit/LayoutTests/media/video-source-error.html b/third_party/WebKit/LayoutTests/media/video-source-error.html index 973d24b..46a5a54 100644 --- a/third_party/WebKit/LayoutTests/media/video-source-error.html +++ b/third_party/WebKit/LayoutTests/media/video-source-error.html
@@ -2,11 +2,13 @@ <title>Test "error" event are fired on "source" elements and not on "video" while processing invalid "source" elements.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video> <source id="missing-src" type="video/blahblah"></source> <source id="bogus-type" src="content/test.mp4" type="video/blahblah"></source> <source id="missing-file" src="content/error2.mpeg" type="video/mpeg"></source> <source id="format-error" src="content/unsupported_track.mov"></source> + <source id="supported-format-mp4" src="content/test.mp4" type="video/mp4; codecs="avc1.4D400C""></source> <source id="supported-format-ogv" src="content/test.ogv" type="video/ogg"></source> </video> <script> @@ -32,7 +34,7 @@ video.onloadeddata = t.step_func_done(function() { var url = video.currentSrc; - assert_equals(url.substr(url.lastIndexOf("/media/") + 7), "content/test.ogv"); + assert_equals(url.substr(url.lastIndexOf("/media/") + 7), findMediaFile("video", "content/test")); }); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-source-load.html b/third_party/WebKit/LayoutTests/media/video-source-load.html index a402de7..fb866a8 100644 --- a/third_party/WebKit/LayoutTests/media/video-source-load.html +++ b/third_party/WebKit/LayoutTests/media/video-source-load.html
@@ -33,16 +33,16 @@ // Add an invalid url to the first source so we test getting // an error event each time resource selection runs. - addSource("content/bogus.ogv"); - addSource("content/test.ogv"); - addSource("content/test.oga"); + addSource("video", "content/bogus"); + addSource("video", "content/test"); + addSource("audio", "content/test"); // test networkState. assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE); - function addSource(filePath) { + function addSource(type, name) { var source = document.createElement("source"); - source.src = filePath; + source.src = findMediaFile(type, name); sourceUrls.push(source.src); source.type = mimeTypeForExtension(source.src.split(".").pop()); video.appendChild(source);
diff --git a/third_party/WebKit/LayoutTests/media/video-source-moved.html b/third_party/WebKit/LayoutTests/media/video-source-moved.html index d8ed856..2dadf69 100644 --- a/third_party/WebKit/LayoutTests/media/video-source-moved.html +++ b/third_party/WebKit/LayoutTests/media/video-source-moved.html
@@ -56,7 +56,7 @@ function addSource(index) { var source = document.createElement("source"); - source.src = index + "-" + Date.now() + ".ogv"; + source.src = findMediaFile("video", index + "-" + Date.now()); source.type = mimeTypeForExtension(source.src.split(".").pop()); video.appendChild(source);
diff --git a/third_party/WebKit/LayoutTests/media/video-source-removed.html b/third_party/WebKit/LayoutTests/media/video-source-removed.html index 1c91335f..9b5350a6 100644 --- a/third_party/WebKit/LayoutTests/media/video-source-removed.html +++ b/third_party/WebKit/LayoutTests/media/video-source-removed.html
@@ -23,7 +23,7 @@ function addSource(index) { source = document.createElement("source"); - source.src = index + "-" + Date.now() + ".ogv"; + source.src = findMediaFile("video", index + "-" + Date.now()); source.type = mimeTypeForExtension(source.src.split(".").pop()); video.appendChild(source); }
diff --git a/third_party/WebKit/LayoutTests/media/video-source-type-params.html b/third_party/WebKit/LayoutTests/media/video-source-type-params.html index d40e502..02c5b7d 100644 --- a/third_party/WebKit/LayoutTests/media/video-source-type-params.html +++ b/third_party/WebKit/LayoutTests/media/video-source-type-params.html
@@ -2,6 +2,7 @@ <title>Test "source" element "type" attribute with "params".</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video> <source src=content/bogus.mpeg type="video/blahblah"> <source src=content/test.mp4 type="video/mpeg; codecs="avc1.4D400C""> @@ -14,7 +15,7 @@ video.onloadstart = t.step_func_done(function() { var url = video.currentSrc; - assert_equals(url.substr(url.lastIndexOf("/media/") + 7), "content/test.ogv"); + assert_equals(url.substr(url.lastIndexOf("/media/") + 7), findMediaFile("video", "content/test")); }); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-source-type.html b/third_party/WebKit/LayoutTests/media/video-source-type.html index 06bc0ea9..7e156f7e 100644 --- a/third_party/WebKit/LayoutTests/media/video-source-type.html +++ b/third_party/WebKit/LayoutTests/media/video-source-type.html
@@ -2,10 +2,12 @@ <title>Test "source" element "type" attribute.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video> <source src=content/error.mpeg type=video/blahblah> <source src=test.mp4 type=video/x-chicken-face> <source src=test.ogv type=audio/x-higglety-pigglety> + <source src=content/test.mp4 type=video/mp4> <source src=content/test.ogv type=video/ogg> <source src=content/error2.mpeg type=video/mpeg> </video> @@ -15,7 +17,7 @@ video.onloadstart = t.step_func_done(function() { var url = video.currentSrc; - assert_equals(url.substr(url.lastIndexOf("/media/") + 7), "content/test.ogv"); + assert_equals(url.substr(url.lastIndexOf("/media/") + 7), findMediaFile("video", "content/test")); }); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-source.html b/third_party/WebKit/LayoutTests/media/video-source.html index d3529a6..1f4b6b5c 100644 --- a/third_party/WebKit/LayoutTests/media/video-source.html +++ b/third_party/WebKit/LayoutTests/media/video-source.html
@@ -2,6 +2,7 @@ <title>Test "source" element.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video> <source></source> </video> @@ -9,7 +10,7 @@ async_test(function(t) { var video = document.querySelector("video"); var source = document.querySelector("source"); - var mediaFile = "content/test.ogv"; + var mediaFile = findMediaFile("video", "content/test"); source.src = mediaFile; video.onloadstart = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-src-blob.html b/third_party/WebKit/LayoutTests/media/video-src-blob.html index b6f1d9d..e5d76d12e 100644 --- a/third_party/WebKit/LayoutTests/media/video-src-blob.html +++ b/third_party/WebKit/LayoutTests/media/video-src-blob.html
@@ -2,6 +2,7 @@ <title>This tests the ability of the "video" element to load blob URLs. In the browser, select a video file.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <input type="file"> <video></video> <script> @@ -15,7 +16,7 @@ video.src = URL.createObjectURL(event.target.files[0]); }); - eventSender.beginDragWithFiles(["content/test.ogv"]); + eventSender.beginDragWithFiles([findMediaFile("video", "content/test")]); var centerX = inputFile.offsetLeft + inputFile.offsetWidth / 2; var centerY = inputFile.offsetTop + inputFile.offsetHeight / 2; eventSender.mouseMoveTo(centerX, centerY);
diff --git a/third_party/WebKit/LayoutTests/media/video-src-change.html b/third_party/WebKit/LayoutTests/media/video-src-change.html index efaa768..5cd6604b 100644 --- a/third_party/WebKit/LayoutTests/media/video-src-change.html +++ b/third_party/WebKit/LayoutTests/media/video-src-change.html
@@ -2,6 +2,7 @@ <title>Test that an invalid "src" fires an error event and changing "src" to a valid one triggers media load.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> // 1. Test that an invalid src attribute fires an error when the file fails to load. @@ -22,7 +23,7 @@ return; } - mediaFile = "content/counting.ogv"; + mediaFile = findMediaFile("video", "content/counting"); video.src = mediaFile; }); @@ -32,7 +33,7 @@ assert_equals(url.substr(url.lastIndexOf("/media/")+7), "bogus"); assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE); assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED); - mediaFile = "content/test.ogv"; + mediaFile = findMediaFile("video", "content/test"); video.src = mediaFile; });
diff --git a/third_party/WebKit/LayoutTests/media/video-src-empty.html b/third_party/WebKit/LayoutTests/media/video-src-empty.html index b22dccd..f75a6639b 100644 --- a/third_party/WebKit/LayoutTests/media/video-src-empty.html +++ b/third_party/WebKit/LayoutTests/media/video-src-empty.html
@@ -2,6 +2,7 @@ <title>Video element with src="" should invoke media element's load algorithm and should fire "error" event. Network state should be NETWORK_NO_SOURCE and the error code should be MEDIA_ERR_SRC_NOT_SUPPORTED.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -25,6 +26,6 @@ }); // video with valid non-empty "src" attribute. - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html b/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html index 451f14e..5b4b715 100644 --- a/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html +++ b/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html
@@ -2,6 +2,7 @@ <title>Test that removing "src" attribute does not trigger load of "source" elements.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -17,7 +18,7 @@ video.src = "bogus.mov"; var source = document.createElement("source"); - source.src = "content/test.ogv"; + source.src = findMediaFile("video", "content/test"); video.appendChild(source); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-src-plus-source.html b/third_party/WebKit/LayoutTests/media/video-src-plus-source.html index 646e914e..5b75d85 100644 --- a/third_party/WebKit/LayoutTests/media/video-src-plus-source.html +++ b/third_party/WebKit/LayoutTests/media/video-src-plus-source.html
@@ -2,6 +2,7 @@ <title>Test that a "source" element is not used when a bogus "src" attribute is present.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video> <source></source> </video> @@ -22,7 +23,7 @@ setTimeout(t.step_func_done(), 200) ; }); - document.querySelector("source").src = "content/test.ogv"; + document.querySelector("source").src = findMediaFile("video", "content/test"); var mediaFile = "content/bogus.mpeg"; video.src = mediaFile; });
diff --git a/third_party/WebKit/LayoutTests/media/video-src-remove.html b/third_party/WebKit/LayoutTests/media/video-src-remove.html index 4b7e35f..0abcdaa1 100644 --- a/third_party/WebKit/LayoutTests/media/video-src-remove.html +++ b/third_party/WebKit/LayoutTests/media/video-src-remove.html
@@ -2,6 +2,7 @@ <title>Test that removing valid "src" attribute doesn't trigger load of "source" elements.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video> <source></source> </video> @@ -25,8 +26,8 @@ assert_false(isNaN(video.duration)); } - document.querySelector("source").src = "content/counting.ogv"; - var mediaFile = "content/test.ogv"; + document.querySelector("source").src = findMediaFile("video", "content/counting"); + var mediaFile = findMediaFile("video", "content/test"); video.src = mediaFile; }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-src-set.html b/third_party/WebKit/LayoutTests/media/video-src-set.html index 6c454d3..5bf8e00 100644 --- a/third_party/WebKit/LayoutTests/media/video-src-set.html +++ b/third_party/WebKit/LayoutTests/media/video-src-set.html
@@ -2,11 +2,12 @@ <title>Test that setting "src" attribute triggers load.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - var mediaFile = "content/test.ogv"; + var mediaFile = findMediaFile("video", "content/test"); video.onloadstart = t.step_func_done(function() { var url = video.currentSrc;
diff --git a/third_party/WebKit/LayoutTests/media/video-src-source.html b/third_party/WebKit/LayoutTests/media/video-src-source.html index 36dede9..be84df7c 100644 --- a/third_party/WebKit/LayoutTests/media/video-src-source.html +++ b/third_party/WebKit/LayoutTests/media/video-src-source.html
@@ -2,13 +2,14 @@ <title>Test that a "source" element is not used when "src" attribute is set.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video> <source></source> </video> <script> async_test(function(t) { var video = document.querySelector("video"); - var mediaFile = "content/test.ogv"; + var mediaFile = findMediaFile("video", "content/test"); video.onloadstart = t.step_func_done(function() { var url = video.currentSrc;
diff --git a/third_party/WebKit/LayoutTests/media/video-src.html b/third_party/WebKit/LayoutTests/media/video-src.html index b86a37f6..35c6b5a 100644 --- a/third_party/WebKit/LayoutTests/media/video-src.html +++ b/third_party/WebKit/LayoutTests/media/video-src.html
@@ -2,11 +2,12 @@ <title>Verify media element's "src" attribute on "loadstart" event.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - var mediaFile = "content/test.ogv"; + var mediaFile = findMediaFile("video", "content/test"); video.onloadstart = t.step_func_done(function () { var url = video.currentSrc;
diff --git a/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html b/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html index 70f2f0e..b5a3e4cf 100644 --- a/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html +++ b/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html
@@ -2,11 +2,12 @@ <title>Test "timeupdate" events are posted while playing but not while paused.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { var video = document.querySelector("video"); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); video.onplaying = t.step_func(function() { video.ontimeupdate = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-transformed.html b/third_party/WebKit/LayoutTests/media/video-transformed.html index 247e6b81..1e64bf9 100644 --- a/third_party/WebKit/LayoutTests/media/video-transformed.html +++ b/third_party/WebKit/LayoutTests/media/video-transformed.html
@@ -10,6 +10,6 @@ <video style="transform:skew(20deg)"></video><br> <script> init(); -setSrcByTagName('video', 'content/test.ogv'); +setSrcByTagName('video', findMediaFile('video', 'content/test')); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/media/video-volume.html b/third_party/WebKit/LayoutTests/media/video-volume.html index 4575c1a..a447831a 100644 --- a/third_party/WebKit/LayoutTests/media/video-volume.html +++ b/third_party/WebKit/LayoutTests/media/video-volume.html
@@ -2,6 +2,7 @@ <title>Test "volume" attribute.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <video></video> <script> async_test(function(t) { @@ -27,6 +28,6 @@ assert_throws("IndexSizeError", function() { video.volume = -0.5; }); }); - video.src = "content/test.ogv"; + video.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-webkit-appearance-expected.html b/third_party/WebKit/LayoutTests/media/video-webkit-appearance-expected.html index bc4fe520..75d747ed 100644 --- a/third_party/WebKit/LayoutTests/media/video-webkit-appearance-expected.html +++ b/third_party/WebKit/LayoutTests/media/video-webkit-appearance-expected.html
@@ -1,9 +1,10 @@ <!DOCTYPE html> <title>video with -webkit-appearance media-play-button</title> +<script src="media-file.js"></script> <video></video> <script> var video = document.querySelector('video'); -video.src = 'content/test.ogv'; +video.src = findMediaFile('video', 'content/test'); if (window.testRunner) { testRunner.waitUntilDone();
diff --git a/third_party/WebKit/LayoutTests/media/video-webkit-appearance.html b/third_party/WebKit/LayoutTests/media/video-webkit-appearance.html index b79cd12..1633274e 100644 --- a/third_party/WebKit/LayoutTests/media/video-webkit-appearance.html +++ b/third_party/WebKit/LayoutTests/media/video-webkit-appearance.html
@@ -1,5 +1,6 @@ <!DOCTYPE html> <title>video with -webkit-appearance media-play-button</title> +<script src="media-file.js"></script> <style> video { -webkit-appearance: media-play-button; @@ -8,7 +9,7 @@ <video></video> <script> var video = document.querySelector('video'); -video.src = 'content/test.ogv'; +video.src = findMediaFile('video', 'content/test'); if (window.testRunner) { testRunner.waitUntilDone();
diff --git a/third_party/WebKit/LayoutTests/media/video-zoom-controls.html b/third_party/WebKit/LayoutTests/media/video-zoom-controls.html index 290ebcb..bd05f35 100644 --- a/third_party/WebKit/LayoutTests/media/video-zoom-controls.html +++ b/third_party/WebKit/LayoutTests/media/video-zoom-controls.html
@@ -13,7 +13,7 @@ <script src="media-file.js"></script> <script src="video-paint-test.js"></script> </head> -<body onload="setSrcByTagName('video', 'content/test.ogv'); init()"> +<body onload="setSrcByTagName('video', findMediaFile('video', 'content/test')); init()"> <p>Zoomed video with controls.</p> <video width="160" height="120" controls></video> <video class="rotated" width="160" height="120" controls></video>
diff --git a/third_party/WebKit/LayoutTests/media/video-zoom.html b/third_party/WebKit/LayoutTests/media/video-zoom.html index 77841ebb2..2fe261d 100644 --- a/third_party/WebKit/LayoutTests/media/video-zoom.html +++ b/third_party/WebKit/LayoutTests/media/video-zoom.html
@@ -8,7 +8,7 @@ function init() { - setSrcByTagName("video", "content/test.ogv"); + setSrcByTagName("video", findMediaFile("video", "content/test")); var totalCount = document.getElementsByTagName('video').length; var count = totalCount; @@ -21,8 +21,8 @@ if (window.testRunner) { testRunner.waitUntilDone(); - setTimeout(function() { - document.body.appendChild(document.createTextNode('FAIL')); + setTimeout(function() { + document.body.appendChild(document.createTextNode('FAIL')); if (window.testRunner) testRunner.notifyDone(); }, 1500);
diff --git a/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html b/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html index 7296600..1f70d53 100644 --- a/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html +++ b/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html
@@ -2,6 +2,7 @@ <title>This tests that a standalone media document has viewport settings.</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> +<script src="media-file.js"></script> <iframe></iframe> <script> async_test(function(t) { @@ -13,6 +14,6 @@ assert_equals(metaElement.content, "width=device-width"); }); - iframe.src = "content/test.ogv"; + iframe.src = findMediaFile("video", "content/test"); }); </script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js b/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js index af194a14..9f1f904c 100644 --- a/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js +++ b/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
@@ -17,7 +17,13 @@ return chain; } -function loadChromiumResources() { +function performChromiumSetup() { + // Make sure we are actually on Chromium. + if (!Mojo) { + return; + } + + // Load the Chromium-specific resources. let root = window.location.pathname.match(/.*LayoutTests/); let resource_prefix = `${root}/resources`; let gen_prefix = 'file:///gen/'; @@ -28,19 +34,29 @@ `${gen_prefix}/device/bluetooth/public/interfaces/test/fake_bluetooth.mojom.js`, `${resource_prefix}/bluetooth/web-bluetooth-test.js`, `${resource_prefix}/bluetooth/bluetooth-fake-adapter.js`, - ]); + ]) + // Call setBluetoothFakeAdapter() to clean up any fake adapters left over + // by legacy tests. + // Legacy tests that use setBluetoothFakeAdapter() sometimes fail to clean + // their fake adapter. This is not a problem for these tests because the + // next setBluetoothFakeAdapter() will clean it up anyway but it is a + // problem for the new tests that do not use setBluetoothFakeAdapter(). + // TODO(crbug.com/569709): Remove once setBluetoothFakeAdapter is no + // longer used. + .then(() => setBluetoothFakeAdapter ? setBluetoothFakeAdapter('') + : undefined); } + // These tests rely on the User Agent providing an implementation of the // Web Bluetooth Testing API. // https://docs.google.com/document/d/1Nhv_oVDCodd1pEH_jj9k8gF4rPGb_84VYaZ9IG8M_WY/edit?ts=59b6d823#heading=h.7nki9mck5t64 function bluetooth_test(func, name, properties) { Promise.resolve() - .then(() => { - // Load Chromium specific resources when Mojo bindings are detected. - if (Mojo) return loadChromiumResources(); - }) - .then(() => promise_test(func, name, properties)); + .then(() => promise_test(t => Promise.resolve() + // Trigger Chromium-specific setup. + .then(performChromiumSetup) + .then(() => func(t)), name, properties)); } // HCI Error Codes. Used for simulateGATT[Dis]ConnectionResponse.
diff --git a/third_party/WebKit/LayoutTests/resources/bluetooth/web-bluetooth-test.js b/third_party/WebKit/LayoutTests/resources/bluetooth/web-bluetooth-test.js index fb54febd..1658ff1 100644 --- a/third_party/WebKit/LayoutTests/resources/bluetooth/web-bluetooth-test.js +++ b/third_party/WebKit/LayoutTests/resources/bluetooth/web-bluetooth-test.js
@@ -57,16 +57,6 @@ // hand Windows 10 is a platform that does support LE, even if there is no // Bluetooth radio present. async setLESupported(supported) { - // Call setBluetoothFakeAdapter() to clean up any fake adapters left over - // by legacy tests. - // Legacy tests that use setBluetoothFakeAdapter() sometimes fail to clean - // their fake adapter. This is not a problem for these tests because the - // next setBluetoothFakeAdapter() will clean it up anyway but it is a - // problem for the new tests that do not use setBluetoothFakeAdapter(). - // TODO(crbug.com/569709): Remove once setBluetoothFakeAdapter is no - // longer used. - await setBluetoothFakeAdapter(''); - if (typeof supported !== 'boolean') throw 'Type Not Supported'; await this.fake_bluetooth_ptr_.setLESupported(supported); }
diff --git a/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background-expected.html b/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background-expected.html index 10e71be1..819db39 100644 --- a/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background-expected.html +++ b/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background-expected.html
@@ -8,7 +8,7 @@ <script src="../../../fullscreen/full-screen-test.js"></script> <script src="../../../media/media-file.js"></script> <script> - setSrcById("video", "../../../media/content/test.ogv"); + setSrcById("video", findMediaFile("video", "../../../media/content/test")); var video = document.getElementById('video'); // Bail out early if the full screen API is not enabled or is missing: if (Element.prototype.webkitRequestFullScreen == undefined) {
diff --git a/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background.html b/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background.html index 02e7efa..77b31f0 100644 --- a/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background.html +++ b/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background.html
@@ -8,7 +8,7 @@ <script src="../../../fullscreen/full-screen-test.js"></script> <script src="../../../media/media-file.js"></script> <script> - setSrcById("video", "../../../media/content/test.ogv"); + setSrcById("video", findMediaFile("video", "../../../media/content/test")); var video = document.getElementById('video'); // Bail out early if the full screen API is not enabled or is missing: if (Element.prototype.webkitRequestFullScreen == undefined) {
diff --git a/third_party/WebKit/ManualTests/media-controls.html b/third_party/WebKit/ManualTests/media-controls.html index 4ab7ba7b..8b0fe0c8b 100644 --- a/third_party/WebKit/ManualTests/media-controls.html +++ b/third_party/WebKit/ManualTests/media-controls.html
@@ -68,6 +68,7 @@ </style> <!-- LayoutTests location is hard-coded to avoid duplication of code. --> +<script src="http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/media-file.js"></script> <script> var MEDIA_FILES_LOCATION = 'http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/content'; @@ -194,8 +195,8 @@ function configureMediaFiles() { MEDIA_FILES = { - 'audio': absoluteUrl(MEDIA_FILES_LOCATION + '/test.wav'), - 'video': absoluteUrl(MEDIA_FILES_LOCATION + '/test.ogv'), + 'audio': absoluteUrl(findMediaFile('audio', MEDIA_FILES_LOCATION + '/test')), + 'video': absoluteUrl(findMediaFile('video', MEDIA_FILES_LOCATION + '/test')), 'video-captioned': absoluteUrl(MEDIA_FILES_LOCATION + '/counting-captioned.mov') }
diff --git a/third_party/WebKit/ManualTests/media-default-playback-rate.html b/third_party/WebKit/ManualTests/media-default-playback-rate.html index dfc18885..b980edc 100644 --- a/third_party/WebKit/ManualTests/media-default-playback-rate.html +++ b/third_party/WebKit/ManualTests/media-default-playback-rate.html
@@ -2,6 +2,7 @@ <html> <head> <!-- LayoutTests location is hard-coded to avoid duplication of code. --> + <script src="http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/media-file.js"></script> <script src="http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/video-test.js"></script> <script> @@ -46,7 +47,7 @@ video.addEventListener('playing', playing); // Use the video file from the svn repository to avoid duplicating the file. - video.src = absoluteUrl('http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/content/test.ogv'); + video.src = absoluteUrl(findMediaFile('video', 'http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/content/test')); testRates(); } @@ -67,7 +68,7 @@ </head> <body onload="start()"> - + <video controls > </video> <ul> <li>The current 'playbackRate' and 'defaultPlaybackRate' should be logged every time either changes.</li>
diff --git a/third_party/WebKit/ManualTests/media-muted.html b/third_party/WebKit/ManualTests/media-muted.html index 30a36ab..40e4e418 100644 --- a/third_party/WebKit/ManualTests/media-muted.html +++ b/third_party/WebKit/ManualTests/media-muted.html
@@ -16,7 +16,8 @@ // Mute first vid.muted = true; - vid.src = "https://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/content/audio-describes-video.mp4" + + vid.src = "http://src.chromium.org/svn/trunk/src/chrome/test/data/media/" + findMediaFile("video", "bear"); } </script>
diff --git a/third_party/WebKit/Source/core/inspector/InspectorAuditsAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorAuditsAgent.cpp index 1a5b4d5..169bfd2 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorAuditsAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorAuditsAgent.cpp
@@ -35,14 +35,18 @@ kMaximumEncodeImageHeightInPixels); SkBitmap bitmap = WebImage::FromData(WebData(body, size), maximum_size).GetSkBitmap(); + if (bitmap.isNull()) + return false; + SkImageInfo info = SkImageInfo::Make(bitmap.width(), bitmap.height(), kRGBA_8888_SkColorType, kUnpremul_SkAlphaType); size_t row_bytes = info.minRowBytes(); Vector<unsigned char> pixel_storage(info.computeByteSize(row_bytes)); SkPixmap pixmap(info, pixel_storage.data(), row_bytes); + sk_sp<SkImage> image = SkImage::MakeFromBitmap(bitmap); - if (!SkImage::MakeFromBitmap(bitmap)->readPixels(pixmap, 0, 0)) + if (!image || !image->readPixels(pixmap, 0, 0)) return false; ImageDataBuffer image_to_encode = ImageDataBuffer(
diff --git a/third_party/gvr-android-sdk/test-apks/daydream_home/apk_version_history.txt b/third_party/gvr-android-sdk/test-apks/daydream_home/apk_version_history.txt index 32e25d5..802c165 100644 --- a/third_party/gvr-android-sdk/test-apks/daydream_home/apk_version_history.txt +++ b/third_party/gvr-android-sdk/test-apks/daydream_home/apk_version_history.txt
@@ -9,3 +9,4 @@ v1.7 d5c72438acffe723e7717c45deedd8431bc613e7 v1.8 cbc81aa4db5986f25d2c967f9b1e247cf07cd75e v1.10 eea1bf917782ba00f9194a14e51a7ba1bdc8b896 +v1.12 ac838d3379a1cc5cefe254173d2a463b2df5b5d0
diff --git a/third_party/gvr-android-sdk/test-apks/daydream_home/daydream_home_current.apk.sha1 b/third_party/gvr-android-sdk/test-apks/daydream_home/daydream_home_current.apk.sha1 index 341b948..617599a 100644 --- a/third_party/gvr-android-sdk/test-apks/daydream_home/daydream_home_current.apk.sha1 +++ b/third_party/gvr-android-sdk/test-apks/daydream_home/daydream_home_current.apk.sha1
@@ -1 +1 @@ -eea1bf917782ba00f9194a14e51a7ba1bdc8b896 \ No newline at end of file +ac838d3379a1cc5cefe254173d2a463b2df5b5d0 \ No newline at end of file
diff --git a/third_party/gvr-android-sdk/test-apks/vr_services/apk_version_history.txt b/third_party/gvr-android-sdk/test-apks/vr_services/apk_version_history.txt index c73f0cb..5d665cd 100644 --- a/third_party/gvr-android-sdk/test-apks/vr_services/apk_version_history.txt +++ b/third_party/gvr-android-sdk/test-apks/vr_services/apk_version_history.txt
@@ -13,3 +13,4 @@ v1.8 f8f45ebf1963c5f9862218baca120ea974b87a08 v1.10 d288911f89f70a459b9fae4720bd3c2ecea26920 v1.101 6bb3d2b3bc098a60ed255d74d904157fb223df8d +v1.12 42eebcfe73c4a24d3df6c0513332e93ff3bf6f8c
diff --git a/third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk.sha1 b/third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk.sha1 index 0a207b1c..6e5cc73 100644 --- a/third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk.sha1 +++ b/third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk.sha1
@@ -1 +1 @@ -6bb3d2b3bc098a60ed255d74d904157fb223df8d +42eebcfe73c4a24d3df6c0513332e93ff3bf6f8c \ No newline at end of file
diff --git a/tools/perf/benchmarks/v8_browsing.py b/tools/perf/benchmarks/v8_browsing.py index 221abae..d56565672 100644 --- a/tools/perf/benchmarks/v8_browsing.py +++ b/tools/perf/benchmarks/v8_browsing.py
@@ -150,6 +150,9 @@ def GetExpectations(self): class StoryExpectations(story.expectations.StoryExpectations): def SetExpectations(self): + self.DisableBenchmark( + [story.expectations.ANDROID_ONE], + 'crbug.com/788797') self.DisableStory( 'browse:shopping:avito', [story.expectations.ANDROID_ONE], @@ -247,6 +250,9 @@ def GetExpectations(self): class StoryExpectations(story.expectations.StoryExpectations): def SetExpectations(self): + self.DisableBenchmark( + [story.expectations.ANDROID_ONE], + 'crbug.com/788797') self.DisableStory( 'browse:shopping:avito', [story.expectations.ANDROID_ONE],
diff --git a/ui/base/ui_base_switches.cc b/ui/base/ui_base_switches.cc index 910a369..d35bde1 100644 --- a/ui/base/ui_base_switches.cc +++ b/ui/base/ui_base_switches.cc
@@ -53,6 +53,11 @@ // Enables touch event based drag and drop. const char kEnableTouchDragDrop[] = "enable-touch-drag-drop"; +// Forces high-contrast mode in native UI drawing, regardless of system +// settings. Note that this has limited effect on Windows: only Aura colors will +// be switched to high contrast, not other system colors. +const char kForceHighContrast[] = "force-high-contrast"; + // TODO(dcastagna): Draw debug quad borders only when it is actually // an overlay candidate. // Renders a border around GL composited overlay candidate quads to
diff --git a/ui/base/ui_base_switches.h b/ui/base/ui_base_switches.h index 93af32b..fbcca7e9 100644 --- a/ui/base/ui_base_switches.h +++ b/ui/base/ui_base_switches.h
@@ -38,6 +38,7 @@ UI_BASE_EXPORT extern const char kDisableTouchDragDrop[]; UI_BASE_EXPORT extern const char kEnableDrawOcclusion[]; UI_BASE_EXPORT extern const char kEnableTouchDragDrop[]; +UI_BASE_EXPORT extern const char kForceHighContrast[]; UI_BASE_EXPORT extern const char kGlCompositedOverlayCandidateQuadBorder[]; UI_BASE_EXPORT extern const char kLang[]; UI_BASE_EXPORT extern const char kMaterialDesignInkDropAnimationSpeed[];
diff --git a/ui/gfx/color_palette.h b/ui/gfx/color_palette.h index 9fae86f..767f2d2c 100644 --- a/ui/gfx/color_palette.h +++ b/ui/gfx/color_palette.h
@@ -20,6 +20,7 @@ const SkColor kGoogleBlue300 = SkColorSetRGB(0x7B, 0xAA, 0xF7); const SkColor kGoogleBlue500 = SkColorSetRGB(0x42, 0x85, 0xF4); const SkColor kGoogleBlue700 = SkColorSetRGB(0x33, 0x67, 0xD6); +const SkColor kGoogleBlue900 = SkColorSetRGB(0x1C, 0x3A, 0xA9); const SkColor kGoogleRed300 = SkColorSetRGB(0xE6, 0x7C, 0x73); const SkColor kGoogleRed700 = SkColorSetRGB(0xC5, 0x39, 0x29); const SkColor kGoogleGreen300 = SkColorSetRGB(0x57, 0xBB, 0x8A);
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc index 32b649e7..259f4f7c 100644 --- a/ui/native_theme/common_theme.cc +++ b/ui/native_theme/common_theme.cc
@@ -20,6 +20,31 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id, const NativeTheme* base_theme) { + // High contrast overrides the normal colors for certain ColorIds to be much + // darker or lighter. + if (base_theme->UsesHighContrastColors()) { + switch (color_id) { + case NativeTheme::kColorId_ButtonEnabledColor: + case NativeTheme::kColorId_ButtonHoverColor: + return SK_ColorBLACK; + case NativeTheme::kColorId_MenuBorderColor: + case NativeTheme::kColorId_MenuSeparatorColor: + return SK_ColorBLACK; + case NativeTheme::kColorId_SeparatorColor: + return SK_ColorBLACK; + case NativeTheme::kColorId_FocusedBorderColor: + return gfx::kGoogleBlue900; + case NativeTheme::kColorId_UnfocusedBorderColor: + return SK_ColorBLACK; + case NativeTheme::kColorId_TabBottomBorder: + return SK_ColorBLACK; + case NativeTheme::kColorId_ProminentButtonColor: + return gfx::kGoogleBlue900; + default: + break; + } + } + // Second wave of MD colors (colors that only appear in secondary UI). if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { static const SkColor kPrimaryTextColor = SK_ColorBLACK;
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h index c74684a..0127218 100644 --- a/ui/native_theme/native_theme.h +++ b/ui/native_theme/native_theme.h
@@ -420,6 +420,10 @@ // Notify observers of native theme changes. void NotifyObservers(); + // Returns whether this NativeTheme uses higher-contrast colors, controlled by + // system accessibility settings and the system theme. + virtual bool UsesHighContrastColors() const = 0; + protected: NativeTheme(); virtual ~NativeTheme();
diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc index 6711ce93..9694c14a 100644 --- a/ui/native_theme/native_theme_base.cc +++ b/ui/native_theme/native_theme_base.cc
@@ -264,6 +264,11 @@ return gfx::Rect(); } +bool NativeThemeBase::UsesHighContrastColors() const { + return base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kForceHighContrast); +} + NativeThemeBase::NativeThemeBase() : scrollbar_width_(kDefaultScrollbarWidth), scrollbar_button_length_(kDefaultScrollbarButtonLength) {
diff --git a/ui/native_theme/native_theme_base.h b/ui/native_theme/native_theme_base.h index 0e349c5..b5feed4 100644 --- a/ui/native_theme/native_theme_base.h +++ b/ui/native_theme/native_theme_base.h
@@ -36,6 +36,7 @@ bool SupportsNinePatch(Part part) const override; gfx::Size GetNinePatchCanvasSize(Part part) const override; gfx::Rect GetNinePatchAperture(Part part) const override; + bool UsesHighContrastColors() const override; protected: NativeThemeBase();
diff --git a/ui/native_theme/native_theme_mac.h b/ui/native_theme/native_theme_mac.h index be23493..fd30c3c9 100644 --- a/ui/native_theme/native_theme_mac.h +++ b/ui/native_theme/native_theme_mac.h
@@ -45,6 +45,7 @@ State state, const gfx::Rect& rect, const MenuItemExtraParams& menu_item) const override; + bool UsesHighContrastColors() const override; // Paints the styled button shape used for default controls on Mac. The basic // style is used for dialog buttons, comboboxes, and tabbed pane tabs.
diff --git a/ui/native_theme/native_theme_mac.mm b/ui/native_theme/native_theme_mac.mm index a88fafc..758320f 100644 --- a/ui/native_theme/native_theme_mac.mm +++ b/ui/native_theme/native_theme_mac.mm
@@ -16,6 +16,12 @@ #include "ui/gfx/skia_util.h" #include "ui/native_theme/common_theme.h" +@interface NSWorkspace (Redeclarations) + +@property(readonly) BOOL accessibilityDisplayShouldIncreaseContrast; + +@end + namespace { // Values calculated by reading pixels and solving simultaneous equations @@ -283,6 +289,17 @@ } } +bool NativeThemeMac::UsesHighContrastColors() const { + if (NativeThemeBase::UsesHighContrastColors()) + return true; + NSWorkspace* workspace = [NSWorkspace sharedWorkspace]; + if ([workspace respondsToSelector:@selector + (accessibilityDisplayShouldIncreaseContrast)]) { + return workspace.accessibilityDisplayShouldIncreaseContrast; + } + return false; +} + NativeThemeMac::NativeThemeMac() { }
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc index 3cfc65c..374fed2 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc
@@ -10,6 +10,7 @@ #include <vsstyle.h> #include <vssym32.h> +#include "base/command_line.h" #include "base/logging.h" #include "base/macros.h" #include "base/win/scoped_gdi_object.h" @@ -28,6 +29,7 @@ #include "third_party/skia/include/core/SkShader.h" #include "third_party/skia/include/core/SkSurface.h" #include "ui/base/material_design/material_design_controller.h" +#include "ui/base/ui_base_switches.h" #include "ui/display/win/screen_win.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" @@ -150,11 +152,6 @@ } // static -bool NativeThemeWin::IsUsingHighContrastTheme() { - return instance()->IsUsingHighContrastThemeInternal(); -} - -// static void NativeThemeWin::CloseHandles() { instance()->CloseHandlesInternal(); } @@ -272,7 +269,7 @@ } } -bool NativeThemeWin::IsUsingHighContrastThemeInternal() { +bool NativeThemeWin::IsUsingHighContrastThemeInternal() const { if (is_using_high_contrast_valid_) return is_using_high_contrast_; HIGHCONTRAST result; @@ -514,8 +511,8 @@ case kColorId_TreeSelectionBackgroundFocused: return system_colors_[COLOR_HIGHLIGHT]; case kColorId_TreeSelectionBackgroundUnfocused: - return system_colors_[IsUsingHighContrastTheme() ? - COLOR_MENUHIGHLIGHT : COLOR_BTNFACE]; + return system_colors_[UsesHighContrastColors() ? COLOR_MENUHIGHLIGHT + : COLOR_BTNFACE]; // Table case kColorId_TableBackground: @@ -529,8 +526,8 @@ case kColorId_TableSelectionBackgroundFocused: return system_colors_[COLOR_HIGHLIGHT]; case kColorId_TableSelectionBackgroundUnfocused: - return system_colors_[IsUsingHighContrastTheme() ? - COLOR_MENUHIGHLIGHT : COLOR_BTNFACE]; + return system_colors_[UsesHighContrastColors() ? COLOR_MENUHIGHLIGHT + : COLOR_BTNFACE]; case kColorId_TableGroupingIndicatorColor: return system_colors_[COLOR_GRAYTEXT]; @@ -625,6 +622,12 @@ return gfx::Rect(); } +bool NativeThemeWin::UsesHighContrastColors() const { + bool force_enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kForceHighContrast); + return force_enabled || IsUsingHighContrastThemeInternal(); +} + void NativeThemeWin::PaintIndirect(cc::PaintCanvas* destination_canvas, Part part, State state,
diff --git a/ui/native_theme/native_theme_win.h b/ui/native_theme/native_theme_win.h index d69d731d..ab7f78cf 100644 --- a/ui/native_theme/native_theme_win.h +++ b/ui/native_theme/native_theme_win.h
@@ -52,9 +52,6 @@ LAST }; - // Returns true if a high contrast theme is being used. - static bool IsUsingHighContrastTheme(); - // Closes cached theme handles so we can unload the DLL or update our UI // for a theme change. static void CloseHandles(); @@ -78,10 +75,10 @@ const gfx::Rect& rect, const ExtraParams& extra) const override; SkColor GetSystemColor(ColorId color_id) const override; - bool SupportsNinePatch(Part part) const override; gfx::Size GetNinePatchCanvasSize(Part part) const override; gfx::Rect GetNinePatchAperture(Part part) const override; + bool UsesHighContrastColors() const override; protected: friend class NativeTheme; @@ -92,7 +89,7 @@ ~NativeThemeWin() override; private: - bool IsUsingHighContrastThemeInternal(); + bool IsUsingHighContrastThemeInternal() const; void CloseHandlesInternal(); // gfx::SysColorChangeListener implementation:
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc index 28b2e92..b47f14a4 100644 --- a/ui/views/view_unittest.cc +++ b/ui/views/view_unittest.cc
@@ -4790,6 +4790,7 @@ gfx::Rect GetNinePatchAperture(Part part) const override { return gfx::Rect(); } + bool UsesHighContrastColors() const override { return false; } private: DISALLOW_COPY_AND_ASSIGN(TestNativeTheme);