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

!6229 continuationManager新增权限xts适配

Merge pull request !6229 from 杜智海/master
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"name": ".entry", "name": ".entry",
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default" "default"
], ],
"distro": { "distro": {
...@@ -86,10 +86,15 @@ ...@@ -86,10 +86,15 @@
} }
} }
], ],
"reqPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
}
],
"testRunner": { "testRunner": {
"name": "OpenHarmonyTestRunner", "name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner" "srcPath": "TestRunner"
}, },
"srcPath": "" "srcPath": ""
} }
} }
...@@ -12,9 +12,23 @@ ...@@ -12,9 +12,23 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * 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 { export default {
onCreate() { onCreate() {
console.info('TestApplication onCreate'); console.info('TestApplication onCreate');
requestPermission();
}, },
onDestroy() { onDestroy() {
console.info('TestApplication onDestroy'); console.info('TestApplication onDestroy');
......
...@@ -1466,7 +1466,7 @@ describe('continuationManagerTest', function() { ...@@ -1466,7 +1466,7 @@ describe('continuationManagerTest', function() {
done(); done();
} catch (e) { } catch (e) {
console.info("testUpdateContinuationState001 " + e); console.info("testUpdateContinuationState001 " + e);
expect(null).assertFail(); expect(null).assertFail();
done(); done();
} }
}) })
...@@ -1506,7 +1506,7 @@ describe('continuationManagerTest', function() { ...@@ -1506,7 +1506,7 @@ describe('continuationManagerTest', function() {
done(); done();
} catch (e) { } catch (e) {
console.info("testUpdateContinuationState003 " + e); console.info("testUpdateContinuationState003 " + e);
expect(null).assertFail(); expect(e.code == 401).assertTrue();
done(); done();
} }
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册