Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
df8663a7
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
df8663a7
编写于
11月 16, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6493 适配错误码需求与web接口迁移
Merge pull request !6493 from 张馨月/cherry-pick-1668414516
上级
ea553046
e42dc891
变更
23
展开全部
隐藏空白更改
内联
并排
Showing
23 changed file
with
1355 addition
and
0 deletion
+1355
-0
arkui/BUILD.gn
arkui/BUILD.gn
+1
-0
arkui/ace_ets_web_dev_three/AppScope/app.json
arkui/ace_ets_web_dev_three/AppScope/app.json
+21
-0
arkui/ace_ets_web_dev_three/AppScope/resources/base/element/string.json
...web_dev_three/AppScope/resources/base/element/string.json
+8
-0
arkui/ace_ets_web_dev_three/AppScope/resources/base/media/app_icon.png
..._web_dev_three/AppScope/resources/base/media/app_icon.png
+0
-0
arkui/ace_ets_web_dev_three/BUILD.gn
arkui/ace_ets_web_dev_three/BUILD.gn
+41
-0
arkui/ace_ets_web_dev_three/Test.json
arkui/ace_ets_web_dev_three/Test.json
+18
-0
arkui/ace_ets_web_dev_three/entry/src/main/ets/Application/AbilityStage.ts
..._dev_three/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
arkui/ace_ets_web_dev_three/entry/src/main/ets/MainAbility/MainAbility.ts
...b_dev_three/entry/src/main/ets/MainAbility/MainAbility.ts
+37
-0
arkui/ace_ets_web_dev_three/entry/src/main/ets/MainAbility/pages/web.ets
...eb_dev_three/entry/src/main/ets/MainAbility/pages/web.ets
+430
-0
arkui/ace_ets_web_dev_three/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ee/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
arkui/ace_ets_web_dev_three/entry/src/main/ets/test/List.test.ets
...e_ets_web_dev_three/entry/src/main/ets/test/List.test.ets
+19
-0
arkui/ace_ets_web_dev_three/entry/src/main/ets/test/Utils.ets
...i/ace_ets_web_dev_three/entry/src/main/ets/test/Utils.ets
+135
-0
arkui/ace_ets_web_dev_three/entry/src/main/ets/test/WebJsunit.test.ets
..._web_dev_three/entry/src/main/ets/test/WebJsunit.test.ets
+348
-0
arkui/ace_ets_web_dev_three/entry/src/main/module.json
arkui/ace_ets_web_dev_three/entry/src/main/module.json
+41
-0
arkui/ace_ets_web_dev_three/entry/src/main/resources/base/element/string.json
...v_three/entry/src/main/resources/base/element/string.json
+32
-0
arkui/ace_ets_web_dev_three/entry/src/main/resources/base/media/icon.png
...eb_dev_three/entry/src/main/resources/base/media/icon.png
+0
-0
arkui/ace_ets_web_dev_three/entry/src/main/resources/base/profile/main_pages.json
...ree/entry/src/main/resources/base/profile/main_pages.json
+5
-0
arkui/ace_ets_web_dev_three/entry/src/main/resources/rawfile/extra.html
...web_dev_three/entry/src/main/resources/rawfile/extra.html
+7
-0
arkui/ace_ets_web_dev_three/entry/src/main/resources/rawfile/icon.png
...s_web_dev_three/entry/src/main/resources/rawfile/icon.png
+0
-0
arkui/ace_ets_web_dev_three/entry/src/main/resources/rawfile/index.html
...web_dev_three/entry/src/main/resources/rawfile/index.html
+74
-0
arkui/ace_ets_web_dev_three/entry/src/main/resources/rawfile/second.html
...eb_dev_three/entry/src/main/resources/rawfile/second.html
+12
-0
arkui/ace_ets_web_dev_three/entry/src/main/resources/rawfile/webstorage.html
...ev_three/entry/src/main/resources/rawfile/webstorage.html
+39
-0
arkui/ace_ets_web_dev_three/signature/openharmony_sx.p7b
arkui/ace_ets_web_dev_three/signature/openharmony_sx.p7b
+0
-0
未找到文件。
arkui/BUILD.gn
浏览文件 @
df8663a7
...
...
@@ -28,6 +28,7 @@ group("arkui") {
"ace_ets_third_test:ActsAceEtsThirdTest",
"ace_ets_web_dev:ActsAceWebDevTest",
"ace_ets_web_dev_two:ActsAceWebDevTwoTest",
"ace_ets_web_dev_three:ActsAceWebDevThreeTest",
"ace_ets_xcomponent:ActsAceXComponentEtsTest",
"ace_js_attribute_api:ActsAceJsApiTest",
"ace_napi_test:ActsAceNapiEtsTest",
...
...
arkui/ace_ets_web_dev_three/AppScope/app.json
0 → 100644
浏览文件 @
df8663a7
{
"app"
:
{
"bundleName"
:
"com.open.harmony.acewebthreetest"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:
{
"apiCompatibleVersion"
:
9
,
"singleUser"
:
false
}
}
}
\ No newline at end of file
arkui/ace_ets_web_dev_three/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
df8663a7
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
arkui/ace_ets_web_dev_three/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
df8663a7
15.1 KB
arkui/ace_ets_web_dev_three/BUILD.gn
0 → 100644
浏览文件 @
df8663a7
# Copyright (c) 2021 Huawei Device Co., Ltd.
# 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.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceWebDevThreeTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_ets_web_dev_js_assets",
":ace_ets_web_dev_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceWebDevThreeTest"
}
ohos_app_scope("ace_ets_web_dev_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_ets_web_dev_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("ace_ets_web_dev_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_ets_web_dev_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
arkui/ace_ets_web_dev_three/Test.json
0 → 100644
浏览文件 @
df8663a7
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.open.harmony.acewebthreetest"
,
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
"kits"
:
[{
"test-file-name"
:
[
"ActsAceWebDevThreeTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}]
}
\ No newline at end of file
arkui/ace_ets_web_dev_three/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
df8663a7
import
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
arkui/ace_ets_web_dev_three/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
df8663a7
import
Ability
from
'
@ohos.application.Ability
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate windowStage=
"
+
windowStage
)
globalThis
.
windowStage
=
windowStage
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/web
"
,
null
)
}
onWindowStageDestroy
()
{
//Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
arkui/ace_ets_web_dev_three/entry/src/main/ets/MainAbility/pages/web.ets
0 → 100644
浏览文件 @
df8663a7
此差异已折叠。
点击以展开。
arkui/ace_ets_web_dev_three/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
df8663a7
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* 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.
*/
import
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
}
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a com.example.myapplication.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
arkui/ace_ets_web_dev_three/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
df8663a7
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* 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.
*/
import webJsunit from './WebJsunit.test'
export default function testsuite() {
webJsunit()
}
\ No newline at end of file
arkui/ace_ets_web_dev_three/entry/src/main/ets/test/Utils.ets
0 → 100644
浏览文件 @
df8663a7
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* 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.
*/
import events_emitter from '@ohos.events.emitter';
import { expect } from "@ohos/hypium";
export default class Utils {
static sleep(time){
return new Promise((resolve,reject)=>{
setTimeout(()=>{
resolve("ok")
},time)
}).then(()=>{
console.info(`sleep ${time} over...`)
})
}
static registerEvent(testCaseName,expectedValue,eventId,done){
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.ACTION).assertEqual(expectedValue);
console.info(`[${testCaseName}] END`);
done()
}
let innerEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(innerEvent,callBack)
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
static emitEvent(actualValue,eventId){
try {
let backData = {
data: {
"ACTION": actualValue
}
}
let backEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
console.info("webFlag start to emit action state");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("webFlag emit action state err: " + JSON.stringify(err));
}
}
static registerEventTwo(testCaseName,eventId,done){
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.actualValue).assertLarger(backData.data.expectedValue-100);
expect(backData.data.actualValue).assertLess(backData.data.expectedValue-(-100));
console.info(`[${testCaseName}] END`);
done()
}
let innerEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(innerEvent,callBack)
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
static emitEventTwo(expectedValue,actualValue,eventId){
try {
let backData = {
data: {
"expectedValue":expectedValue,
"actualValue":actualValue
}
}
let backEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
console.info("webFlag start to emit action state");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("webFlag emit action state err: " + JSON.stringify(err));
}
}
static registerContainEvent(testCaseName,expectedValue,eventId,done){
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.ACTION).assertContain(expectedValue);
console.info(`[${testCaseName}] END`);
done()
}
let innerEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(innerEvent,callBack)
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
static commitKey(emitKey){
try {
let backData = {
data: {
"ACTION": emitKey
}
}
let backEvent = {
eventId:10,
priority:events_emitter.EventPriority.LOW
}
console.info("start send emitKey");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("emit emitKey err: " + JSON.stringify(err));
}
}
}
arkui/ace_ets_web_dev_three/entry/src/main/ets/test/WebJsunit.test.ets
0 → 100644
浏览文件 @
df8663a7
此差异已折叠。
点击以展开。
arkui/ace_ets_web_dev_three/entry/src/main/module.json
0 → 100644
浏览文件 @
df8663a7
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[{
"name"
:
"com.example.myapplication.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}]
}],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.LOCATION"
},
{
"name"
:
"ohos.permission.INTERNET"
}
]
}
}
arkui/ace_ets_web_dev_three/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
df8663a7
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
arkui/ace_ets_web_dev_three/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
df8663a7
15.1 KB
arkui/ace_ets_web_dev_three/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
df8663a7
{
"src"
:
[
"MainAbility/pages/web"
]
}
\ No newline at end of file
arkui/ace_ets_web_dev_three/entry/src/main/resources/rawfile/extra.html
0 → 100644
浏览文件 @
df8663a7
<!DOCTYPE html>
<html
lang=
"en"
>
<body>
<div
id=
"pageHeight"
></div>
<p
style=
"background-color:green;font-family:arial;color:red;font-size:300px;text-align:center"
>
<a
href=
"http://www.w3school.com.cn"
>
This is a link
</a></p>
</body>
</html>
\ No newline at end of file
arkui/ace_ets_web_dev_three/entry/src/main/resources/rawfile/icon.png
0 → 100644
浏览文件 @
df8663a7
15.1 KB
arkui/ace_ets_web_dev_three/entry/src/main/resources/rawfile/index.html
0 → 100644
浏览文件 @
df8663a7
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
index
</title>
<style>
#pageHeight
{
height
:
1300px
}
</style>
</head>
<body>
<div
id=
"container"
>
首页
</div>
<div
id=
"pageHeight"
></div>
<a
href=
"file:///data/storage/el1/bundle/phone/resources/rawfile/second.html"
id=
"fileAccess"
>
打开rawfile文件
</a>
<img
src=
"file:///data/storage/el1/bundle/phone/resources/rawfile/icon.png"
alt=
"icon"
id=
"imgs"
>
</body>
<script>
let
ele
=
document
.
getElementById
(
"
imgs
"
);
let
loadImage
;
ele
.
onload
=
function
(){
loadImage
=
"
load complete
"
}
function
getUserAgent
(){
return
navigator
.
userAgent
}
function
test
(){
backToEts
.
test
(
"
backToEts
"
)
}
function
testRunJavaScript
(){
return
"
testRunJavaScript
"
}
function
getPageHeight
(){
let
height
=
document
.
body
.
scrollHeight
return
height
}
function
proxy
(){
objName
.
register
(
"
backToEts
"
)
}
function
registerTest
(){
let
str
=
objName
.
register
();
console
.
log
(
str
);
return
str
}
function
jsAccess
(){
console
.
log
(
"
web111
"
)
}
function
consoleTest
(){
console
.
log
(
"
console test
"
)
}
function
alertTest
(){
alert
(
'
alert test
'
)
}
function
confirmTest
(){
confirm
(
"
confirm test
"
)
}
function
getImgResult
(){
return
loadImage
}
function
toPrompt
(){
let
result
=
prompt
(
"
age
"
,
"
20
"
);
console
.
log
(
"
result:
"
+
result
)
}
function
openRawFile
(){
document
.
getElementById
(
"
fileAccess
"
).
click
()
}
function
htmlTest
(){
let
str
=
objName
.
testOne
(
'
Web
'
)
return
str
}
</script>
</html>
arkui/ace_ets_web_dev_three/entry/src/main/resources/rawfile/second.html
0 → 100644
浏览文件 @
df8663a7
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
second
</title>
</head>
<body>
<div
style=
"height: 1300px;background-color: #999999;"
>
second pages
</div>
</body>
</html>
\ No newline at end of file
arkui/ace_ets_web_dev_three/entry/src/main/resources/rawfile/webstorage.html
0 → 100644
浏览文件 @
df8663a7
<!DOCTYPE HTML>
<html>
<head>
<meta
charset=
"UTF-8"
>
<script
type=
"text/javascript"
>
var
db
=
openDatabase
(
'
mydb
'
,
'
1.0
'
,
'
Test DB
'
,
2
*
1024
*
1024
);
var
msg
;
db
.
transaction
(
function
(
tx
)
{
tx
.
executeSql
(
'
CREATE TABLE IF NOT EXISTS LOGS (id unique, log)
'
);
tx
.
executeSql
(
'
INSERT INTO LOGS (id, log) VALUES (1, "W3Cschool教程")
'
);
tx
.
executeSql
(
'
INSERT INTO LOGS (id, log) VALUES (2, "www.w3cschool.cn")
'
);
msg
=
'
<p>数据表已创建,且插入了两条数据。</p>
'
;
document
.
querySelector
(
'
#status
'
).
innerHTML
=
msg
;
});
db
.
transaction
(
function
(
tx
)
{
tx
.
executeSql
(
'
SELECT * FROM LOGS
'
,
[],
function
(
tx
,
results
)
{
var
len
=
results
.
rows
.
length
,
i
;
msg
=
"
<p>查询记录条数:
"
+
len
+
"
</p>
"
;
document
.
querySelector
(
'
#status
'
).
innerHTML
+=
msg
;
for
(
i
=
0
;
i
<
len
;
i
++
){
msg
=
"
<p><b>
"
+
results
.
rows
.
item
(
i
).
log
+
"
</b></p>
"
;
document
.
querySelector
(
'
#status
'
).
innerHTML
+=
msg
;
}
},
null
);
});
</script>
</head>
<body>
<div
id=
"status"
name=
"status"
>
状态信息
</div>
</body>
</html>
\ No newline at end of file
arkui/ace_ets_web_dev_three/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
df8663a7
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录