diff --git a/test/LocalWebServer.php b/test/LocalWebServer.php new file mode 100644 index 000000000..dfdf43835 --- /dev/null +++ b/test/LocalWebServer.php @@ -0,0 +1,76 @@ +_driver = &new E34_Net_Server_Driver_Fork($hostname, $port); + $this->_driver->readEndCharacter = "\r\n\r\n"; + $this->_driver->setCallbackObject($this); + } + + function GET($clientId, &$request) { + $path_info = $request->getPathInfo(); + $path_translated = $this->documentRoot . $path_info; + + $headers = array(); + + // path does not exist + if (!file_exists($path_translated)) { + return array( + "code" => 404 + ); + } + + if (is_readable($path_translated) ) { + $body = fopen($path_translated, "rb"); + } + + return array( + "code" => 200, + "headers" => $headers, + "body" => $body + ); + } +} + +class E34_Net_Server_Driver_Fork extends Net_Server_Driver_Fork { + function serviceRequest() { + while (true) { + $readFDs = array($this->clientFD[0]); + + // block and wait for data + $ready = @socket_select($readFDs, $this->null, $this->null, null); + // the auto-request of favicon.ico gives things fits, so null check + if ($ready === false && $this->clientFD[0] && socket_last_error($this->clientFD[0]) !== 0) { + $this->_sendDebugMessage('socket_select() failed.'); + $this->shutdown(); + } + + if (in_array($this->clientFD[0], $readFDs) && (!$ready===false)) { + $data = $this->readFromSocket(); + + // empty data => connection was closed + if ($data === false) { + $this->_sendDebugMessage('Connection closed by peer'); + $this->closeConnection(); + } else { + $this->_sendDebugMessage('Received ' . trim($data) . ' from ' . $this->_getDebugInfo()); + + if (method_exists($this->callbackObj, 'onReceiveData')) { + $this->callbackObj->onReceiveData(0, $data); + } + } + } + } + } +} + diff --git a/www/alerts.html b/www/alerts.html new file mode 100644 index 000000000..3ae831b6c --- /dev/null +++ b/www/alerts.html @@ -0,0 +1,73 @@ + + + Testing Alerts + + + + + +

Testing Alerts and Stuff

+ +

This tests alerts: click me

+ +

This tests alerts: click me

+ +

Let's make the prompt happen

+ +

Let's make the prompt with default happen

+ +

Let's make TWO prompts happen

+ +

A SLOW alert

+ +

This is a test of a confirm: + test confirm

+ +

This is a test of showModalDialog: test dialog

+ +

This is a test of an alert in an iframe: + +

+ +

This is a test of an alert in a nested iframe: + +

+ +

This is a test of an alert open from onload event handler: open new page

+ +

This is a test of an alert open from onload event handler: open new window

+ +

This is a test of an alert open from onunload event handler: open new page

+ +

This is a test of an alert open from onclose event handler: open new window

+ +

This is a test of an alert open from onclose event handler: open new window

+ +
+
+
+ +