107ac75b1Sopenharmony_ci/*
207ac75b1Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
307ac75b1Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
407ac75b1Sopenharmony_ci * you may not use this file except in compliance with the License.
507ac75b1Sopenharmony_ci * You may obtain a copy of the License at
607ac75b1Sopenharmony_ci *
707ac75b1Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
807ac75b1Sopenharmony_ci *
907ac75b1Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1007ac75b1Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1107ac75b1Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1207ac75b1Sopenharmony_ci * See the License for the specific language governing permissions and
1307ac75b1Sopenharmony_ci * limitations under the License.
1407ac75b1Sopenharmony_ci */
1507ac75b1Sopenharmony_ci
1607ac75b1Sopenharmony_ciexports.source = `
1707ac75b1Sopenharmony_ciimport { router1, router2 } from "@system.router";
1807ac75b1Sopenharmony_ciimport { app } from "@system.router";
1907ac75b1Sopenharmony_ciimport { fetch } from "@system.fetch";
2007ac75b1Sopenharmony_ci
2107ac75b1Sopenharmony_ciimport { router1, router2, router3 } = require('@system.router');
2207ac75b1Sopenharmony_ciimport { app1, app2 } = require('@system.app');
2307ac75b1Sopenharmony_ciimport { fetch } = require('@system.fetch');
2407ac75b1Sopenharmony_ci
2507ac75b1Sopenharmony_ciimport router from "@system.router"
2607ac75b1Sopenharmony_ciimport app from "@system.router"
2707ac75b1Sopenharmony_ciimport fetch from "@system.fetch"
2807ac75b1Sopenharmony_ci
2907ac75b1Sopenharmony_ciimport router = require('@system.router')
3007ac75b1Sopenharmony_ciimport app = require('@system.app')
3107ac75b1Sopenharmony_ciimport fetch = require('@system.fetch')
3207ac75b1Sopenharmony_ci
3307ac75b1Sopenharmony_ciimport fetch from '@ohos.net.http'
3407ac75b1Sopenharmony_ci
3507ac75b1Sopenharmony_ciimport hello from 'libhello.so'
3607ac75b1Sopenharmony_ciimport world = require('libworld.so')`
3707ac75b1Sopenharmony_ci
3807ac75b1Sopenharmony_ciexports.expectResult =
3907ac75b1Sopenharmony_ci`"use strict";
4007ac75b1Sopenharmony_cilet __generate__Id = 0;
4107ac75b1Sopenharmony_cifunction generateId() {
4207ac75b1Sopenharmony_ci    return "importSystemApi_" + ++__generate__Id;
4307ac75b1Sopenharmony_ci}
4407ac75b1Sopenharmony_civar { router1, router2 } = globalThis.requireNativeModule('system.router');
4507ac75b1Sopenharmony_civar { app } = globalThis.requireNativeModule('system.router');
4607ac75b1Sopenharmony_civar { fetch } = isSystemplugin('fetch', 'system') ? globalThis.systemplugin.fetch : globalThis.requireNapi('fetch');
4707ac75b1Sopenharmony_civar { router1, router2, router3 } = globalThis.requireNativeModule('system.router');
4807ac75b1Sopenharmony_civar { app1, app2 } = globalThis.requireNativeModule('system.app');
4907ac75b1Sopenharmony_civar { fetch } = isSystemplugin('fetch', 'system') ? globalThis.systemplugin.fetch : globalThis.requireNapi('fetch');
5007ac75b1Sopenharmony_civar router = globalThis.requireNativeModule('system.router');
5107ac75b1Sopenharmony_civar app = globalThis.requireNativeModule('system.router');
5207ac75b1Sopenharmony_civar fetch = isSystemplugin('fetch', 'system') ? globalThis.systemplugin.fetch : globalThis.requireNapi('fetch');
5307ac75b1Sopenharmony_civar router = globalThis.requireNativeModule('system.router');
5407ac75b1Sopenharmony_civar app = globalThis.requireNativeModule('system.app');
5507ac75b1Sopenharmony_civar fetch = isSystemplugin('fetch', 'system') ? globalThis.systemplugin.fetch : globalThis.requireNapi('fetch');
5607ac75b1Sopenharmony_civar fetch = globalThis.requireNapi('net.http') || (isSystemplugin('net.http', 'ohos') ? globalThis.ohosplugin.net.http : isSystemplugin('net.http', 'system') ? globalThis.systemplugin.net.http : undefined);
5707ac75b1Sopenharmony_civar hello = globalThis.requireNapi("hello", true);
5807ac75b1Sopenharmony_civar world = globalThis.requireNapi("world", true);
5907ac75b1Sopenharmony_ci`
60