Remove redundant canvas helper
This commit is contained in:
@@ -16,14 +16,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.k2js.test.semantics;
|
package org.jetbrains.k2js.test.semantics;
|
||||||
|
|
||||||
import closurecompiler.internal.com.google.common.collect.Lists;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.k2js.test.SingleFileTranslationTest;
|
import org.jetbrains.k2js.test.SingleFileTranslationTest;
|
||||||
import org.mozilla.javascript.EcmaError;
|
import org.mozilla.javascript.EcmaError;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Pavel Talanov
|
* @author Pavel Talanov
|
||||||
*/
|
*/
|
||||||
@@ -33,8 +29,6 @@ import java.util.List;
|
|||||||
* */
|
* */
|
||||||
public final class WebDemoCanvasExamplesTest extends SingleFileTranslationTest {
|
public final class WebDemoCanvasExamplesTest extends SingleFileTranslationTest {
|
||||||
|
|
||||||
private static final String CANVAS_HELPER = pathToTestFilesRoot() + "canvas_helper.js";
|
|
||||||
|
|
||||||
public WebDemoCanvasExamplesTest() {
|
public WebDemoCanvasExamplesTest() {
|
||||||
super("webDemoCanvasExamples/");
|
super("webDemoCanvasExamples/");
|
||||||
}
|
}
|
||||||
@@ -68,11 +62,4 @@ public final class WebDemoCanvasExamplesTest extends SingleFileTranslationTest {
|
|||||||
e.getMessage().startsWith(expectedErrorMessage));
|
e.getMessage().startsWith(expectedErrorMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected List<String> additionalJSFiles() {
|
|
||||||
ArrayList<String> result = Lists.newArrayList(super.additionalJSFiles());
|
|
||||||
result.add(CANVAS_HELPER);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2012 JetBrains s.r.o.
|
|
||||||
*
|
|
||||||
* 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 getContext() {
|
|
||||||
return getCanvas().getContext('2d');
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCanvas() {
|
|
||||||
return document.getElementsByTagName('canvas')[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
function getKotlinLogo() {
|
|
||||||
return document.getElementsByTagName('img')[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
function getImage(src) {
|
|
||||||
var image = document.createElement("img");
|
|
||||||
image.src = src;
|
|
||||||
return image;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user