summaryrefslogtreecommitdiffstats
path: root/tools/page_cycler
diff options
context:
space:
mode:
authorchase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 21:45:18 +0000
committerchase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 21:45:18 +0000
commit7fc262d827153f49ca7aa6f4ad2edf8cd64fd75a (patch)
tree2b10b888355f96f16d88800c7236211ab0ffbbe0 /tools/page_cycler
parent5ac950bb1af4dba863e3616a6af8f5ed6a935981 (diff)
downloadchromium_src-7fc262d827153f49ca7aa6f4ad2edf8cd64fd75a.zip
chromium_src-7fc262d827153f49ca7aa6f4ad2edf8cd64fd75a.tar.gz
chromium_src-7fc262d827153f49ca7aa6f4ad2edf8cd64fd75a.tar.bz2
Add sample page cycler to mirror online docs.
BUG=none TEST=run chrome targetted at the sample, ensure the page cycler runs to completion Review URL: http://codereview.chromium.org/5724002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68767 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/page_cycler')
-rw-r--r--tools/page_cycler/common/head.js39
-rw-r--r--tools/page_cycler/sample/page1/index.html9
-rw-r--r--tools/page_cycler/sample/page2/index.html9
-rw-r--r--tools/page_cycler/sample/page3/index.html9
-rw-r--r--tools/page_cycler/sample/page4/index.html9
-rw-r--r--tools/page_cycler/sample/pages.js10
-rw-r--r--tools/page_cycler/sample/start.html7
7 files changed, 61 insertions, 31 deletions
diff --git a/tools/page_cycler/common/head.js b/tools/page_cycler/common/head.js
index 1a4ddc84..3cbe38f 100644
--- a/tools/page_cycler/common/head.js
+++ b/tools/page_cycler/common/head.js
@@ -1,30 +1,6 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Copyright (c) 2010 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.
var __c = ""; // that's good enough for me.
var __td;
@@ -74,15 +50,16 @@ function __ontimeout() {
} else {
doc = "../" + __pages()[__page] + "/index.html"
}
-
+
var timings = __tl;
var oldTimings = __get_timings();
- if (oldTimings != "") {
+ if (oldTimings != "") {
timings = oldTimings + "," + timings;
}
__set_timings(timings);
-
- var url = doc + "?n=" + __iterations + "&i=" + __cycle + "&p=" + __page + "&ts=" + ts + "&td=" + __td + "&tf=" + __tf;
+
+ var url = doc + "?n=" + __iterations + "&i=" + __cycle + "&p=" + __page +
+ "&ts=" + ts + "&td=" + __td + "&tf=" + __tf;
document.location.href = url;
}
function __onload() {
diff --git a/tools/page_cycler/sample/page1/index.html b/tools/page_cycler/sample/page1/index.html
new file mode 100644
index 0000000..26a2e3a
--- /dev/null
+++ b/tools/page_cycler/sample/page1/index.html
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Page1</title>
+ <script src="../../common/head.js"></script>
+ </head>
+ <body>
+ <h1>Page1</h1>
+ </body>
+</html>
diff --git a/tools/page_cycler/sample/page2/index.html b/tools/page_cycler/sample/page2/index.html
new file mode 100644
index 0000000..a020a97
--- /dev/null
+++ b/tools/page_cycler/sample/page2/index.html
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Page2</title>
+ <script src="../../common/head.js"></script>
+ </head>
+ <body>
+ <h1>Page2</h1>
+ </body>
+</html>
diff --git a/tools/page_cycler/sample/page3/index.html b/tools/page_cycler/sample/page3/index.html
new file mode 100644
index 0000000..1f819a2
--- /dev/null
+++ b/tools/page_cycler/sample/page3/index.html
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Page3</title>
+ <script src="../../common/head.js"></script>
+ </head>
+ <body>
+ <h1>Page3</h1>
+ </body>
+</html>
diff --git a/tools/page_cycler/sample/page4/index.html b/tools/page_cycler/sample/page4/index.html
new file mode 100644
index 0000000..0079dd9
--- /dev/null
+++ b/tools/page_cycler/sample/page4/index.html
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Page4</title>
+ <script src="../../common/head.js"></script>
+ </head>
+ <body>
+ <h1>Page4</h1>
+ </body>
+</html>
diff --git a/tools/page_cycler/sample/pages.js b/tools/page_cycler/sample/pages.js
new file mode 100644
index 0000000..a512131
--- /dev/null
+++ b/tools/page_cycler/sample/pages.js
@@ -0,0 +1,10 @@
+// Copyright (c) 2010 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.
+
+var __pages = [
+ "page1",
+ "page2",
+ "page3",
+ "page4",
+];
diff --git a/tools/page_cycler/sample/start.html b/tools/page_cycler/sample/start.html
new file mode 100644
index 0000000..c30e8d8
--- /dev/null
+++ b/tools/page_cycler/sample/start.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+<h3>Note: You must have started chrome with <tt>--enable-file-cookies</tt> for this test to work manually.</h3>
+<script src="pages.js"></script>
+<script src="../common/start.js"></script>
+</body>
+</html>