Revision: 4521
Author: jasvir
Date: Wed Jun 22 10:59:16 2011
Log: Remove deprecated hosttools tests
http://codereview.appspot.com/4634079
Remove deprecated hosttools tests
[email protected]
http://code.google.com/p/google-caja/source/detail?r=4521
Deleted:
/trunk/tests/com/google/caja/plugin/HostIframeTest.java
/trunk/tests/com/google/caja/plugin/host-iframe-test.html
/trunk/tests/com/google/caja/plugin/host-iframe-test.js
=======================================
--- /trunk/tests/com/google/caja/plugin/HostIframeTest.java Thu Nov 18
22:30:18 2010
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (C) 2010 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.google.caja.plugin;
-
-import com.google.caja.util.FailureIsAnOption;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-
-import java.util.List;
-
-/**
- * Run the JSUnit tests in host-iframe-test.html in a web browser.
- *
- * @author [email protected]
- */
-public class HostIframeTest extends BrowserTestCase {
- @FailureIsAnOption
- public final void testHostIframe() {
- runBrowserTest("host-iframe-test.html");
- }
-
- @Override
- protected void driveBrowser(final WebDriver driver, final String
pageName) {
- poll(10000, 200, new Check() {
- @Override public String toString() { return "startup"; }
- public boolean run() {
- List<WebElement> readyElements = driver.findElements(
- By.xpath("//*[@class='readytotest']"));
- return readyElements.size() != 0;
- }
- });
-
- poll(15000, 1000, new Check() {
- @Override public String toString() { return "completion"; }
- public boolean run() {
- return driver.getTitle().contains("all tests passed");
- }
- });
- }
-}
=======================================
--- /trunk/tests/com/google/caja/plugin/host-iframe-test.html Thu Nov 18
22:30:18 2010
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
- - Copyright (C) 2010 Google Inc.
- -
- - Licensed under the Apache License, Version 2.0 (the "License");
- - you may not use this file except in compliance with the License.
- - You may obtain a copy of the License at
- -
- - http://www.apache.org/licenses/LICENSE-2.0
- -
- - Unless required by applicable law or agreed to in writing, software
- - distributed under the License is distributed on an "AS IS" BASIS,
- - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- - See the License for the specific language governing permissions and
- - limitations under the License.
--->
-<html>
- <head>
- <title>Host-Tools Iframe Tests</title>
-
- <!-- Test framework -->
- <script type="text/javascript" src="../console.js"></script>
- <script type="text/javascript"
src="../../../../js/jsunit/2.2/jsUnitCore.js"
- ></script>
- <script type="text/javascript" src="jsunit.js"></script>
-
- <!-- That under test -->
- <script type="text/javascript" src="caja-orig.js"></script>
-
- <!-- Tests -->
- <script type="text/javascript" src="host-iframe-test.js"></script>
- </head>
-
- <body onload="testPageLoaded()">
-
- <div id="automatedTestingReadyIndicator"></div>
- <!-- used for Java test driver -->
-
-</body>
-</html>
=======================================
--- /trunk/tests/com/google/caja/plugin/host-iframe-test.js Thu Jul 22
10:23:41 2010
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright (C) 2010 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//------------------------------------------------------------------------------
-
-function setUp() {
-}
-
-function tearDown() {
-}
-
-function testPageLoaded() {
- var testState =
document.getElementById("automatedTestingReadyIndicator");
- testState.className = "readytotest";
- jsunitRun();
-}
-
-//------------------------------------------------------------------------------
-
-/*
-Unfortunately, this test doesn't work because other tests running
asynchronously
-also change the layout of the page.
-
-jsunitRegister("testDoesNotShowUpOnPage",
- function testDoesNotShowUpOnPage() {
- function getSize() {
- return window.getComputedStyle(document.body, null).height;
- }
- // not using jsunitCallback because that creates opportunities for the
on-page
- // console to change the size.
- window.setTimeout((function () {
- var size = getSize();
- loadCaja((function (framedCaja) {
- assertEquals("page size after loading Caja frame", size, getSize());
- jsunit.pass("testDoesNotShowUpOnPage");
- }));
- }), 0);
-});
-*/
-
-jsunitRegister("testBadOptionsIsCaught",
- function testBadOptionsIsCaught() {
- try {
- loadCaja(jsunitCallback(function (framedCaja) {
- throw new Error("Shouldn't reach here (1)");
- }), "http://localhost:8000/caja/");
- } catch (e) {
- console.log("(passed due to error ", e, ")");
- jsunit.pass();
- return;
- }
- throw new Error("Shouldn't reach here (2)");
-});
-
-jsunitRegister("testCajaServerOptionIsSignificant",
- function testCajaServerOptionIsSignificant() {
- var fail = false;
- loadCaja(jsunitCallback(function (framedCaja) {
- fail = true;
- throw new Error("Shouldn't reach here (1)");
- }), {cajaServer: "http://bogus.example.invalid:48261/"});
- setTimeout(jsunitCallback(function () {
- // TODO: arrange to reliably detect loading errors in loadCaja and
report
- if (!fail) {
- jsunit.pass();
- }
- }), 2000);
-});
-
-jsunitRegister("testRunGadget",
- function testRunGadget() {
- var e = document.createElement("div");
- document.body.appendChild(e);
-
- loadCaja(jsunitCallback(function (framedCaja) {
- var tools = framedCaja.hostTools;
- var s = new tools.Sandbox();
- s.attach(e);
-
- framedCaja.Q.when(s.run("../../../../../src/com/google/caja/" +
- "demos/container/gadget-trivial.html"),
- jsunitCallback(function (moduleResult) {
- assertNotEquals(0, e.childNodes.length);
- jsunit.pass();
- }), jsunitCallback(function (reason) {
- throw reason;
- }));
- }), {cajaServer: "http://localhost:8000/caja/"});
-});
-
-// This is primarily a HostTools test, but it is relevant to reexamine its
-// success in the iframe context because it is necessary that the eval
occur in
-// the correct frame.
-jsunitRegister("testEvalModule",
- function testEvalModule() {
- loadCaja(jsunitCallback(function (framedCaja) {
- var tools = framedCaja.hostTools;
- var s = new tools.Sandbox();
- s.imports.h = 36;
-
- var res = s.runCajoledModuleString(
- "{___.loadModule({'instantiate':" +
- "function(___,IMPORTS___){return IMPORTS___.h + 1}})}");
- assertEquals(37, res);
-
- jsunit.pass();
- }), {cajaServer: "http://localhost:8000/caja/"});
-});
-