提交 af301e4b 编写于 作者: D du-zhihai

continuationManager新增权限xts适配

Signed-off-by: Ndu-zhihai <duzhihai@huawei.com>
Change-Id: I958076c19b0acedc75c7b39e186f84855df9f0b5
上级 02204690
......@@ -17,7 +17,7 @@
"name": ".entry",
"mainAbility": ".MainAbility",
"deviceType": [
"tablet",
"tablet",
"default"
],
"distro": {
......@@ -86,10 +86,15 @@
}
}
],
"reqPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
}
],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
},
"srcPath": ""
}
}
}
......@@ -12,9 +12,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import featureAbility from '@ohos.ability.featureAbility';
async function requestPermission() {
try {
let context = featureAbility.getContext();
await context.requestPermissionsFromUser(['ohos.permission.DISTRIBUTED_DATASYNC'], 666, (data) => {
console.info('TestApplication requestPermission data: ' + JSON.stringify(data));
});
} catch (err) {
console.error('TestApplication permission' + JSON.stringify(err));
}
}
export default {
onCreate() {
console.info('TestApplication onCreate');
requestPermission();
},
onDestroy() {
console.info('TestApplication onDestroy');
......
......@@ -1466,7 +1466,7 @@ describe('continuationManagerTest', function() {
done();
} catch (e) {
console.info("testUpdateContinuationState001 " + e);
expect(null).assertFail();
expect(e.code == 401).assertTrue();
done();
}
})
......@@ -1506,7 +1506,7 @@ describe('continuationManagerTest', function() {
done();
} catch (e) {
console.info("testUpdateContinuationState003 " + e);
expect(null).assertFail();
expect(e.code == 401).assertTrue();
done();
}
})
......@@ -1528,7 +1528,7 @@ describe('continuationManagerTest', function() {
done();
} catch (e) {
console.info("testUpdateContinuationState004 " + e);
expect(null).assertFail();
expect(e.code == 401).assertTrue();
done();
}
})
......@@ -1550,7 +1550,7 @@ describe('continuationManagerTest', function() {
done();
} catch (e) {
console.info("testUpdateContinuationState005 " + e);
expect(null).assertFail();
expect(e.code == 401).assertTrue();
done();
}
})
......@@ -1571,7 +1571,7 @@ describe('continuationManagerTest', function() {
done();
} catch (e) {
console.info("testUpdateContinuationState006 " + e);
expect(null).assertFail();
expect(e.code == 401).assertTrue();
done();
}
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册