From cb774a7c70db1ae46fe722b300687577f3ec6cd4 Mon Sep 17 00:00:00 2001 From: dirk41 <1378902882@qq.com> Date: Mon, 17 May 2021 11:08:02 +0800 Subject: [PATCH] =?UTF-8?q?README=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../protectsoft/webviewcode/CodeViewTest.java | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/library/src/test/java/com/protectsoft/webviewcode/CodeViewTest.java b/library/src/test/java/com/protectsoft/webviewcode/CodeViewTest.java index 8c49268..9e2e196 100644 --- a/library/src/test/java/com/protectsoft/webviewcode/CodeViewTest.java +++ b/library/src/test/java/com/protectsoft/webviewcode/CodeViewTest.java @@ -1,7 +1,6 @@ package com.protectsoft.webviewcode; import ohos.agp.components.webengine.WebView; -import ohos.net.NetHandle; import org.junit.Test; import static org.mockito.Mockito.mock; @@ -26,54 +25,11 @@ public class CodeViewTest { @Test public void withHtmlTest(){ codeview.withHtml("

h1 injected header

"); - codeview.withText("this text is always wrap inside pre tags"); - codeview.withCode("function Constructor(v1,v2,v3)\n" + "{\n" - + " this.v1 = v1;\n" - + " this.v2 = v2;\n" - + " this.funk = function()\n" - + " {\n" - + " console.log(\"Test: \"+ v3 );\n" - + " }\n" - + "}\n" - + "\n" - + "var obj1 = new Constructor(\"par1\",\"par2\",\"par3\");\n" - + "var arr = [\"w1\",\"w2\",\"w3\",obj1];\n" + "\n" - + "function f2()\n" + "{ \n" - + " obj1.funk(); //works ok\n" - + " console.log(\"test \"+tablica[3].funk.call() ); //doesn't work\n" - + "}"); - codeview.withHtml("

h1 header after code

"); - codeview.withHtml("
my html table
"); - codeview.setStyle(Settings.WithStyle.DEFAULT); - codeview.setLang(Settings.Lang.JAVASCRIPT); - codeview.setAutoWrap(true); - codeview.into(webview); } @Test public void withTextTest(){ codeview.withText("this text is always wrap inside pre tags"); - codeview.withCode("function Constructor(v1,v2,v3)\n" + "{\n" - + " this.v1 = v1;\n" - + " this.v2 = v2;\n" - + " this.funk = function()\n" - + " {\n" - + " console.log(\"Test: \"+ v3 );\n" - + " }\n" - + "}\n" - + "\n" - + "var obj1 = new Constructor(\"par1\",\"par2\",\"par3\");\n" - + "var arr = [\"w1\",\"w2\",\"w3\",obj1];\n" + "\n" - + "function f2()\n" + "{ \n" - + " obj1.funk(); //works ok\n" - + " console.log(\"test \"+tablica[3].funk.call() ); //doesn't work\n" - + "}"); - codeview.withHtml("

h1 header after code

"); - codeview.withHtml("
my html table
"); - codeview.setStyle(Settings.WithStyle.DEFAULT); - codeview.setLang(Settings.Lang.JAVASCRIPT); - codeview.setAutoWrap(true); - codeview.into(webview); } @Test @@ -98,15 +54,11 @@ public class CodeViewTest { @Test public void setStyleTest(){ codeview.setStyle(Settings.WithStyle.DEFAULT); - codeview.setLang(Settings.Lang.JAVASCRIPT); - codeview.setAutoWrap(true); - codeview.into(webview); } @Test public void setAutoWrapTest(){ codeview.setAutoWrap(true); - codeview.into(webview); } @Test -- Gitee