示例#1
0
        protected IEnumerator EnsureSelectorsCanBeAddedAndReloadBuilder()
        {
            var builderWindow = BuilderWindow;

            // Need to have at least one element in the asset.
            if (builderWindow.document.visualTreeAsset.IsEmpty())
            {
                AddElementCodeOnly("TestElement");
            }

            yield return(UIETestHelpers.Pause(1));

            // If the builder currently has no stylesheets,
            // we add the test one so we can add selectors.
            if (builderWindow.document.firstStyleSheet == null)
            {
                // Make sure there's no modified version in memory.
                AssetDatabase.ImportAsset(
                    k_TestEmptyUSSFilePath,
                    ImportAssetOptions.ForceUpdate | ImportAssetOptions.ForceSynchronousImport);

                yield return(UIETestHelpers.Pause(1));

                BuilderStyleSheetsUtilities.AddUSSToAsset(builderWindow, k_TestEmptyUSSFilePath);
            }

            yield return(UIETestHelpers.Pause(1));

            StyleSheetsPane.elementHierarchyView.ExpandAllChildren();
            HierarchyPane.elementHierarchyView.ExpandAllChildren();
        }
示例#2
0
        protected IEnumerator CodeOnlyAddUSSToDocument(string path)
        {
            var builderWindow = BuilderWindow;

            // Need to have at least one element in the asset.
            if (builderWindow.document.visualTreeAsset.IsEmpty())
            {
                AddElementCodeOnly("TestElement");
            }

            yield return(UIETestHelpers.Pause(1));

            // Make sure there's no modified version in memory.
            AssetDatabase.ImportAsset(
                k_TestEmptyUSSFilePath,
                ImportAssetOptions.ForceUpdate | ImportAssetOptions.ForceSynchronousImport);

            yield return(UIETestHelpers.Pause(1));

            BuilderStyleSheetsUtilities.AddUSSToAsset(builderWindow, path);

            yield return(UIETestHelpers.Pause(1));

            StyleSheetsPane.elementHierarchyView.ExpandAllChildren();
            HierarchyPane.elementHierarchyView.ExpandAllChildren();
        }