コード例 #1
0
        protected override IEnumerator runTest()
        {
            string payload = "test/test_cube?dl=www-bundle&x=txt";

            ContentManifest.AssetEntry entry            = ContentManifest.AssetEntry.Parse(payload);
            DeviceManager         deviceManager         = new DeviceManager();
            GcsAccessTokenService gcsAccessTokenService = new GcsAccessTokenService(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountName"), new GcsP12AssetFileLoader(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountFile")));
            CPipeManifestService  cpipeManifestService  = new CPipeManifestService("https://storage.googleapis.com/ad37ed76-3a24-91ba-def6-2ff16973c49d.disney.io/", "__mapping_cpremix_dev.json", gcsAccessTokenService);

            deviceManager.Mount(new WwwBundleDevice(deviceManager, gcsAccessTokenService, cpipeManifestService));
            AssetRequest <AssetBundle> request = deviceManager.LoadAsync <AssetBundle>(entry.DeviceList, ref entry);

            IntegrationTestEx.FailIf(request == null);
            IntegrationTestEx.FailIf(request.Finished);
            IntegrationTestEx.FailIf(request.Cancelled);
            yield return(request);

            IntegrationTest.Assert(request.Finished);
            IntegrationTest.Assert(!request.Cancelled);
            IntegrationTest.Assert(request.Asset != null);
            IntegrationTest.Assert(request.Asset.GetAllAssetNames().Length == 1);
            string[] assetNames = request.Asset.GetAllAssetNames();
            IntegrationTest.Assert(assetNames.Contains("assets/bundleassets/test/test_cube.prefab"));
            request.Asset.Unload(unloadAllLoadedObjects: false);
        }
コード例 #2
0
    protected override IEnumerator setup()
    {
        GcsAccessTokenService gcsAccessTokenService = new GcsAccessTokenService(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountName"), new GcsP12AssetFileLoader(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountFile")));

        Service.Set((IGcsAccessTokenService)gcsAccessTokenService);
        string cdnUrl = ContentHelper.GetCdnUrl();
        string cpipeMappingFilename = ContentHelper.GetCpipeMappingFilename();
        CPipeManifestService cpipeManifestService = new CPipeManifestService(cdnUrl, cpipeMappingFilename, gcsAccessTokenService);

        Service.Set((ICPipeManifestService)cpipeManifestService);
        base.gameObject.AddComponent <KeyChainManager>();
        GameSettings gameSettings = new GameSettings();

        Service.Set(gameSettings);
        ContentManifest definition = ContentManifestUtility.FromDefinitionFile("Configuration/embedded_content_manifest");

        Service.Set(new Content(definition));
        Localizer localizer = Localizer.Instance;

        Service.Set(localizer);
        NullCPSwrveService cpSwrveService = new NullCPSwrveService();

        Service.Set((ICPSwrveService)cpSwrveService);
        NetworkServicesConfig networkConfig = NetworkController.GenerateNetworkServiceConfig(TestEnvironment);

        Service.Set((INetworkServicesManager) new NetworkServicesManager(this, networkConfig, offlineMode: false));
        CommerceService commerceService = new CommerceService();

        commerceService.Setup();
        Service.Set(commerceService);
        Service.Set(new MembershipService(null));
        ConnectionManager connectionManager = base.gameObject.AddComponent <ConnectionManager>();

        Service.Set(connectionManager);
        Service.Set(new SessionManager());
        Service.Set(new MixLoginCreateService());
        Service.Set((CPDataEntityCollection) new CPDataEntityCollectionImpl());
        LocalPlayerData localPlayerData = new LocalPlayerData
        {
            name         = "TestPlayer",
            tutorialData = new List <sbyte>()
        };
        PlayerId playerId = localPlayerData.id = new PlayerId
        {
            id   = "999999999999999",
            type = PlayerId.PlayerIdType.SESSION_ID
        };

        Service.Get <CPDataEntityCollection>().ResetLocalPlayerHandle();
        PlayerDataEntityFactory.AddLocalPlayerProfileDataComponents(Service.Get <CPDataEntityCollection>(), localPlayerData);
        LoginController loginController = new LoginController();

        Service.Set(loginController);
        loginController.SetNetworkConfig(networkConfig);
        IntegrationTestEx.FailIf(Service.Get <MixLoginCreateService>().NetworkConfigIsNotSet);
        yield return(null);
    }
コード例 #3
0
        protected override IEnumerator setup()
        {
            base.gameObject.AddComponent <KeyChainManager>();
            GameSettings gameSettings = new GameSettings();

            Service.Set(gameSettings);
            ContentManifest       definition            = ContentManifestUtility.FromDefinitionFile("Configuration/embedded_content_manifest");
            GcsAccessTokenService gcsAccessTokenService = new GcsAccessTokenService(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountName"), new GcsP12AssetFileLoader(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountFile")));

            Service.Set((IGcsAccessTokenService)gcsAccessTokenService);
            string cdnUrl = ContentHelper.GetCdnUrl();
            string cpipeMappingFilename = ContentHelper.GetCpipeMappingFilename();
            CPipeManifestService cpipeManifestService = new CPipeManifestService(cdnUrl, cpipeMappingFilename, gcsAccessTokenService);

            Service.Set((ICPipeManifestService)cpipeManifestService);
            NullCPSwrveService cpSwrveService = new NullCPSwrveService();

            Service.Set((ICPSwrveService)cpSwrveService);
            Content content = new Content(definition);

            Service.Set(content);
            networkServicesConfig = NetworkController.GenerateNetworkServiceConfig(Disney.Kelowna.Common.Environment.Environment.LOCAL);
            ConnectionManager connectionManager = base.gameObject.AddComponent <ConnectionManager>();

            Service.Set(connectionManager);
            initEnvironmentManager();
            sessionManager = new SessionManager();
            Service.Set(sessionManager);
            Localizer localizer = Localizer.Instance;

            Service.Set(localizer);
            Language language = LocalizationLanguage.GetLanguage();

            localizer.Language       = language;
            localizer.LanguageString = LocalizationLanguage.GetLanguageString(language);
            AppTokensFilePath tokensFilePath = new AppTokensFilePath(Localizer.DEFAULT_TOKEN_LOCATION, Platform.global);
            bool tokensLoaded = false;

            Service.Get <Localizer>().LoadTokensFromLocalJSON(tokensFilePath, delegate
            {
                Debug.Log("Tokens for " + localizer.LanguageString + " have been loaded.");
                tokensLoaded = true;
            });
            while (!tokensLoaded)
            {
                yield return(null);
            }
            mixLoginCreateService = new MixLoginCreateService();
            Service.Set(mixLoginCreateService);
            IntegrationTestEx.FailIf(!mixLoginCreateService.NetworkConfigIsNotSet);
            mixLoginCreateService.SetNetworkConfig(networkServicesConfig);
            IntegrationTestEx.FailIf(mixLoginCreateService.NetworkConfigIsNotSet);
            yield return(null);
        }
コード例 #4
0
    public override IEnumerator PerformFirstPass()
    {
        IGcsAccessTokenService gcsAccessTokenService = new GcsAccessTokenService(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountName"), new GcsP12AssetFileLoader(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountFile")));

        Service.Set(gcsAccessTokenService);
        ICPipeManifestService cpipeManifestService = new CPipeManifestService(ContentHelper.GetCdnUrl(), ContentHelper.GetCpipeMappingFilename(), gcsAccessTokenService);

        Service.Set(cpipeManifestService);
        ContentSystemManager contentSystemManager = new ContentSystemManager(Service.Get <ApplicationService>());

        Service.Set(contentSystemManager);
        yield return(contentSystemManager.InitContentSystem());
    }
コード例 #5
0
        protected override IEnumerator setup()
        {
            manifest = generateManifest();
            IGcsAccessTokenService gcsAccessTokenService = new GcsAccessTokenService(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountName"), new GcsP12AssetFileLoader(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountFile")));

            Service.Set(gcsAccessTokenService);
            ICPipeManifestService instance = new CPipeManifestService(ContentHelper.GetCdnUrl(), ContentHelper.GetCpipeMappingFilename(), gcsAccessTokenService);

            Service.Set(instance);
            Content instance2 = new Content(manifest);

            Service.Set(instance2);
            Content.BundleManager.UnmountFrameCount     = 4;
            Content.BundleManager.MonitorFrameFrequency = 1;
            yield break;
        }
コード例 #6
0
 public MockCPipeManifestServices(IGcsAccessTokenService gcsAccessTokenService)
 {
     cpipeManifestService = new CPipeManifestService(ContentHelper.GetCdnUrl(), ContentHelper.GetCpipeMappingFilename(), gcsAccessTokenService);
 }