From 5ddde30071f639962dd557c453f2ad01f8f0fd00 Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Wed, 8 Sep 2010 12:18:00 +0100 Subject: Merge WebKit at r66666 : Initial merge by git. Change-Id: I57dedeb49859adc9c539e760f0e749768c66626f --- .../http/tests/resources/network-simulator.php | 40 +++++++++++++++++++++ LayoutTests/http/tests/resources/silence.mpg | Bin 33227 -> 0 bytes LayoutTests/http/tests/resources/test.mp4 | Bin 0 -> 192844 bytes LayoutTests/http/tests/resources/test.ogv | Bin 0 -> 103746 bytes 4 files changed, 40 insertions(+) delete mode 100644 LayoutTests/http/tests/resources/silence.mpg create mode 100644 LayoutTests/http/tests/resources/test.mp4 create mode 100644 LayoutTests/http/tests/resources/test.ogv (limited to 'LayoutTests/http') diff --git a/LayoutTests/http/tests/resources/network-simulator.php b/LayoutTests/http/tests/resources/network-simulator.php index 3f1201f..4860028 100644 --- a/LayoutTests/http/tests/resources/network-simulator.php +++ b/LayoutTests/http/tests/resources/network-simulator.php @@ -120,6 +120,38 @@ function handleGetResourceCountCommand($path) } } +function handleStartResourceRequestsLog() +{ + $resourceLogFile = sys_get_temp_dir() . "/resource-log"; + file_put_contents($resourceLogFile, ""); +} + +function handleClearResourceRequestsLog() +{ + $resourceLogFile = sys_get_temp_dir() . "/resource-log"; + file_put_contents($resourceLogFile, ""); +} + +function handleGetResourceRequestsLog() +{ + $resourceLogFile = sys_get_temp_dir() . "/resource-log"; + + generateNoCacheHTTPHeader(); + header("Content-Type: text/plain"); + + print file_get_contents($resourceLogFile); +} + +function handleLogResourceRequest($path) +{ + $resourceLogFile = sys_get_temp_dir() . "/resource-log"; + + $newData = "\n".$path; + // Documentation says that appends are atomic. + file_put_contents($resourceLogFile, $newData, FILE_APPEND); + generateResponse($path); +} + $stateFile = sys_get_temp_dir() . "/network-simulator-state"; $command = $_GET['command']; if ($command) { @@ -133,6 +165,14 @@ if ($command) { handleResetResourceCountCommand(); else if ($command == "get-resource-count") handleGetResourceCountCommand($_GET['path']); + else if ($command == "start-resource-request-log") + handleStartResourceRequestsLog(); + else if ($command == "clear-resource-request-log") + handleClearResourceRequestsLog(); + else if ($command == "get-resource-request-log") + handleGetResourceRequestsLog(); + else if ($command == "log-resource-request") + handleLogResourceRequest($_GET['path']); else echo "Unknown command: " . $command . "\n"; exit(); diff --git a/LayoutTests/http/tests/resources/silence.mpg b/LayoutTests/http/tests/resources/silence.mpg deleted file mode 100644 index b6bbf20..0000000 Binary files a/LayoutTests/http/tests/resources/silence.mpg and /dev/null differ diff --git a/LayoutTests/http/tests/resources/test.mp4 b/LayoutTests/http/tests/resources/test.mp4 new file mode 100644 index 0000000..d278c8a Binary files /dev/null and b/LayoutTests/http/tests/resources/test.mp4 differ diff --git a/LayoutTests/http/tests/resources/test.ogv b/LayoutTests/http/tests/resources/test.ogv new file mode 100644 index 0000000..c9ee910 Binary files /dev/null and b/LayoutTests/http/tests/resources/test.ogv differ -- cgit v1.1