| Index: ppapi/tests/test_case.html
|
| ===================================================================
|
| --- ppapi/tests/test_case.html (revision 91865)
|
| +++ ppapi/tests/test_case.html (working copy)
|
| @@ -66,67 +66,6 @@
|
| return "";
|
| }
|
|
|
| -// Parses the message, looking for strings of the form:
|
| -// TESTING_MESSAGE:<message_type>:<message_contents>
|
| -//
|
| -// If the message_data is not a string or does not match the above format, then
|
| -// undefined is returned.
|
| -//
|
| -// Otherwise, returns an array containing 2 items. The 0th element is the
|
| -// message_type, one of:
|
| -// - ClearContents
|
| -// - DidExecuteTests
|
| -// - LogHTML
|
| -// - SetCookie
|
| -// The second item is the verbatim message_contents.
|
| -function ParseTestingMessage(message_data) {
|
| - if (typeof(message_data)!='string')
|
| - return undefined;
|
| - var testing_message_prefix = "TESTING_MESSAGE";
|
| - var delim_str = ":";
|
| - var delim1 = message_data.indexOf(delim_str);
|
| - if (message_data.substring(0, delim1) !== testing_message_prefix)
|
| - return undefined;
|
| - var delim2 = message_data.indexOf(delim_str, delim1 + 1);
|
| - if (delim2 == -1)
|
| - delim2 = message_data.length;
|
| - var message_type = message_data.substring(delim1 + 1, delim2);
|
| - var message_contents = message_data.substring(delim2 + 1);
|
| - return [message_type, message_contents];
|
| -}
|
| -
|
| -function ClearConsole() {
|
| - window.document.getElementById("console").innerHTML = "";
|
| -}
|
| -
|
| -function LogHTML(html) {
|
| - window.document.getElementById("console").innerHTML += html;
|
| -}
|
| -
|
| -function SetCookie(key_value_string) {
|
| - window.document.cookie = key_value_string + "; path=/";
|
| -}
|
| -
|
| -function IsTestingMessage(message_data) {
|
| - return (ParseTestingMessage(message_data) != undefined);
|
| -}
|
| -
|
| -function handleTestingMessage(message_event) {
|
| - var type_contents_tuple = ParseTestingMessage(message_event.data);
|
| - if (type_contents_tuple) {
|
| - var type = type_contents_tuple[0];
|
| - var contents = type_contents_tuple[1];
|
| - if (type === "ClearConsole")
|
| - ClearConsole();
|
| - else if (type === "DidExecuteTests")
|
| - DidExecuteTests();
|
| - else if (type === "LogHTML")
|
| - LogHTML(contents);
|
| - else if (type === "SetCookie")
|
| - SetCookie(contents);
|
| - }
|
| -}
|
| -
|
| onload = function() {
|
| var testcase = ExtractSearchParameter("testcase");
|
| var mode = ExtractSearchParameter("mode");
|
| @@ -152,10 +91,7 @@
|
| if (obj) {
|
| obj.setAttribute("id", "plugin");
|
| obj.setAttribute("testcase", testcase);
|
| - obj.setAttribute("protocol", window.location.protocol);
|
| - var container = document.getElementById("container");
|
| - container.appendChild(obj);
|
| - container.addEventListener("message", handleTestingMessage, true);
|
| + document.getElementById("container").appendChild(obj);
|
| }
|
| }
|
| </script>
|
|
|