未验证 提交 259be4f3 编写于 作者: O openharmony_ci 提交者: Gitee

!6229 continuationManager新增权限xts适配

Merge pull request !6229 from 杜智海/master
......@@ -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(null).assertFail();
done();
}
})
......@@ -1506,7 +1506,7 @@ describe('continuationManagerTest', function() {
done();
} catch (e) {
console.info("testUpdateContinuationState003 " + 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.
先完成此消息的编辑!
想要评论请 注册