summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FunctionalTests')
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page2
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.page21
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.php27
-rw-r--r--tests/FunctionalTests/active-controls/tests/CallbackTimerTestCase.php21
4 files changed, 70 insertions, 1 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page
index 8eff7105..c475f17f 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page
@@ -7,5 +7,5 @@
<com:TActiveLabel ID="label1" Text="Label 1" />
<com:TJavascriptLogger />
-
+
</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.page b/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.page
new file mode 100644
index 00000000..8e99e528
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.page
@@ -0,0 +1,21 @@
+<com:TForm ID="form1">
+ <h1>TCallbackTimer + ViewState Tests</h1>
+ <com:TActiveButton id="button1" Text="Start Timer" OnCallback="start_timer" />
+ <com:TActiveButton Text="Stop Timer" OnCallback="stop_timer" />
+ <div style="margin:1em; padding:1em; border:1px solid #ccc;">
+ <com:TActiveLabel ID="label1" Text="ViewState Counter : " />
+ </div>
+ <com:TCallbackTimer ID="timer1" Interval="0.1" OnCallback="tick">
+ <prop:ActiveControl.ClientSide
+ OnLoading="$('status').show()"
+ OnComplete="$('status').hide()" />
+ </com:TCallbackTimer>
+ <div id="status" style="margin:1em; padding:0.5em;
+ text-align:center;
+ background-color:#900;
+ color:white; display: none;
+ position: absolute; right: 0; top: 0">
+ Loading...
+ </div>
+ <com:TJavascriptLogger />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.php b/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.php
new file mode 100644
index 00000000..da87ac0f
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.php
@@ -0,0 +1,27 @@
+<?php
+
+class CallbackTimerTest extends TPage
+{
+ function start_timer($sender, $param)
+ {
+ $this->timer1->startTimer();
+ $this->setViewState('count', 0);
+ }
+
+ function stop_timer($sender, $param)
+ {
+ $this->timer1->stopTimer();
+ }
+
+ function tick($sender, $param)
+ {
+ $count = intval($this->getViewState('count'));
+ $this->setViewState('count', ++$count);
+ if($count > 10)
+ $this->timer1->stopTimer();
+ else
+ $this->label1->Text .= " ".$count;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/CallbackTimerTestCase.php b/tests/FunctionalTests/active-controls/tests/CallbackTimerTestCase.php
new file mode 100644
index 00000000..2954cc51
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/tests/CallbackTimerTestCase.php
@@ -0,0 +1,21 @@
+<?php
+
+class CallbackTimerTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open("active-controls/index.php?page=CallbackTimerTest");
+ $this->verifyTextPresent("TCallbackTimer + ViewState Tests");
+
+ $this->assertText("label1", "ViewState Counter :");
+
+ $this->click("button1");
+
+ $this->pause(8000);
+
+ $this->assertText("label1", "ViewState Counter : 1 2 3 4 5 6 7 8 9 10");
+
+ }
+}
+
+?> \ No newline at end of file