Example #1
0
 afterLast(function () {
     testWindow      = null;
     DocumentManager = null;
     DragAndDrop     = null;
     EditorManager   = null;
     SpecRunnerUtils.closeTestWindow();
 });
Example #2
0
 afterEach(function () {
     DocumentManager     = null;
     FileViewController  = null;
     JSUtils             = null;
     ProjectManager      = null;
     SpecRunnerUtils.closeTestWindow();
 });
 afterLast(function () {
     testWindow     = null;
     brackets       = null;
     ProjectManager = null;
     CommandManager = null;
     SpecRunnerUtils.closeTestWindow();
 });
Example #4
0
 afterLast(function () {
     testWindow              = null;
     CommandManager          = null;
     Commands                = null;
     DocumentManager         = null;
     SpecRunnerUtils.closeTestWindow();
 });
 afterEach(function () {
     SpecRunnerUtils.closeTestWindow();
     testWindow = null;
     brackets = null;
     LiveDevelopment = null;
     LiveDevProtocol = null;
 });
 afterLast(function () {
     testWindow          = null;
     CommandManager      = null;
     Commands            = null;
     EditorManager       = null;
     FileViewController  = null;
     SpecRunnerUtils.closeTestWindow();
 });
Example #7
0
 afterLast(function () {
     testWindow        = null;
     CommandManager    = null;
     Commands          = null;
     KeyBindingManager = null;
     Menus             = null;
     SpecRunnerUtils.closeTestWindow();
 });
Example #8
0
 afterLast(function () {
     testWindow = null;
     FileFilters = null;
     FindInFiles = null;
     CommandManager = null;
     $ = null;
     SpecRunnerUtils.closeTestWindow();
 });
Example #9
0
 afterLast(function () {
     testWindow          = null;
     CodeHintManager     = null;
     EditorManager       = null;
     CommandManager      = null;
     KeyBindingManager   = null;
     SpecRunnerUtils.closeTestWindow();
 });
 afterLast(function () {
     testWindow               = null;
     TWCommandManager         = null;
     TWEditorManager          = null;
     TWMultiRangeInlineEditor = null;
     SpecRunnerUtils.closeTestWindow();
     
     SpecRunnerUtils.removeTempDirectory();
 });
            afterEach(function () {
                runs(function () {
                    LiveDevelopment.close();
                });

                waitsFor(function () { return !Inspector.connected(); }, "Waiting to close inspector", 10000);

                SpecRunnerUtils.closeTestWindow();
            });
 function closeTestWindow() {
     testWindow          = null;
     CommandManager      = null;
     Commands            = null;
     DocumentManager     = null;
     FileViewController  = null;
     MainViewManager     = null;
     SpecRunnerUtils.closeTestWindow();
 }
Example #13
0
 afterEach(function () {
     testWindow      = null;
     brackets        = null;
     test$           = null;
     executeCommand  = null;
     EditorManager   = null;
     DocumentManager = null;
     SpecRunnerUtils.closeTestWindow();
 });
Example #14
0
 afterEach(function () {
     testWindow              = null;
     CommandManager          = null;
     Commands                = null;
     DocumentCommandHandlers = null;
     DocumentManager         = null;
     PerfUtils               = null;
     SpecRunnerUtils.closeTestWindow();
 });
 afterLast(function () {
     testWindow              = null;
     CommandManager          = null;
     Commands                = null;
     DocumentCommandHandlers = null;
     DocumentManager         = null;
     Dialogs                 = null;
     FileViewController      = null;
     SpecRunnerUtils.closeTestWindow();
 });
 afterEach(function () {
     MainViewManager._closeAll(MainViewManager.ALL_PANES);
     testWindow              = null;
     CommandManager          = null;
     Commands                = null;
     DocumentManager         = null;
     EditorManager           = null;
     ProjectManager          = null;
     FileSystem              = null;
     SpecRunnerUtils.closeTestWindow();
 });
            afterEach(function () {
                runs(function () {
                    LiveDevelopment.close();
                });

                waitsFor(function () {
                    return (LiveDevelopment.status === LiveDevelopment.STATUS_INACTIVE);
                }, "Waiting for browser to become inactive", 10000);

                SpecRunnerUtils.closeTestWindow();
            });
Example #18
0
 afterLast(function () {
     EditorManager = null;
     CommandManager = null;
     DocumentManager = null;
     PreferencesManager = null;
     Commands = null;
     Dialogs = null;
     FileSystem = null;
     testWindow = null;
     SpecRunnerUtils.closeTestWindow();
 });
Example #19
0
 runs(function () {
     testWindow           = null;
     LiveDevelopment      = null;
     LiveDevServerManager = null;
     DOMAgent             = null;
     DocumentManager      = null;
     CommandManager       = null;
     Commands             = null;
     NativeApp            = null;
     ProjectManager       = null;
     SpecRunnerUtils.closeTestWindow();
 });
        it("should rebuild the ui from the model correctly", function () {
            // force the test window to initialize to unit test preferences
            // for just this test
            runs(function () {
                localStorage.setItem("doLoadPreferences", true);
            });
            
            // remove temporary unit test preferences with a single-spec after() 
            this.after(function () {
                localStorage.removeItem("doLoadPreferences");
            });

            // close test window while working set has 2 files (see beforeEach())
            SpecRunnerUtils.closeTestWindow();

            // reopen brackets test window to initialize unit test working set
            SpecRunnerUtils.createTestWindowAndRun(this, function (w) {
                testWindow = w;
            });
            
            var $listItems;
            
            // wait for working set to populate
            waitsFor(
                function () {
                    // check working set UI list content
                    $listItems = testWindow.$("#open-files-container > ul").children();
                    return $listItems.length === 2;
                },
                1000
            );

            // files should be in the working set
            runs(function () {
                expect($listItems.find("a").get(0).text === "file_one.js").toBeTruthy();
                expect($listItems.find("a").get(1).text === "file_two.js").toBeTruthy();

                // files should be clean
                expect($listItems.find(".file-status-icon dirty").length).toBe(0);

                // file_two.js should be active
                expect($($listItems[1]).hasClass("selected")).toBeTruthy();
            });
        });
Example #21
0
        afterEach(function () {
            runs(function () {
                LiveDevelopment.close();
            });
            waitsFor(function () { return !Inspector.connected(); }, "Waiting for to close inspector", 10000);
            waits(20);
            NativeApp._setLiveBrowserUserDataDir("");
            
            if (window.appshell) {
                runs(function () {
                    waitsForDone(NativeApp.closeAllLiveBrowsers(), "NativeApp.closeAllLiveBrowsers", 10000);
                });
            } else {
                // Remove this 'else' after migrating to brackets-shell.
                // brackets-app never resolves the promise for brackets.app.closeLiveBrowser.
                runs(function () {
                    NativeApp.closeAllLiveBrowsers();
                });
                waits(100);
            }

            SpecRunnerUtils.closeTestWindow();
        });
 afterEach(function () {
     testWindow         = null;
     UpdateNotification = null;
     SpecRunnerUtils.closeTestWindow();
 });
Example #23
0
 afterEach(function () {
     SpecRunnerUtils.closeTestWindow();
 });
            it("should update the document's language when a file is renamed", function () {
                var tempDir     = SpecRunnerUtils.getTempDirectory(),
                    oldFilename = tempDir + "/foo.js",
                    newFilename = tempDir + "/dummy.html",
                    spy         = jasmine.createSpy("languageChanged event handler"),
                    javascript,
                    html,
                    oldFile,
                    doc;
                
                var DocumentManager,
                    FileSystem,
                    LanguageManager,
                    _$;
                
                SpecRunnerUtils.createTempDirectory();
                
                SpecRunnerUtils.createTestWindowAndRun(this, function (w) {
                    // Load module instances from brackets.test
                    FileSystem = w.brackets.test.FileSystem;
                    LanguageManager = w.brackets.test.LanguageManager;
                    DocumentManager = w.brackets.test.DocumentManager;
                    _$ = w.$;
                });
                
                var writeDeferred = $.Deferred();
                runs(function () {
                    oldFile = FileSystem.getFileForPath(oldFilename);
                    oldFile.write("", function (err) {
                        if (err) {
                            writeDeferred.reject(err);
                        } else {
                            writeDeferred.resolve();
                        }
                    });
                });
                waitsForDone(writeDeferred.promise(), "old file creation");

                SpecRunnerUtils.loadProjectInTestWindow(tempDir);
                
                runs(function () {
                    waitsForDone(DocumentManager.getDocumentForPath(oldFilename).done(function (_doc) {
                        doc = _doc;
                    }), "get document");
                });

                var renameDeferred = $.Deferred();
                runs(function () {
                    javascript = LanguageManager.getLanguage("javascript");
                    
                    // sanity check language
                    expect(doc.getLanguage()).toBe(javascript);
                    
                    // Documents are only 'active' while referenced; they won't be maintained by DocumentManager
                    // for global updates like rename otherwise.
                    doc.addRef();
                    
                    // listen for event
                    _$(doc).on("languageChanged", spy);
                   
                    // trigger a rename
                    oldFile.rename(newFilename, function (err) {
                        if (err) {
                            renameDeferred.reject(err);
                        } else {
                            renameDeferred.resolve();
                        }
                    });
                });
                waitsForDone(renameDeferred.promise(), "old file rename");
                
                runs(function () {
                    html = LanguageManager.getLanguage("html");
                    
                    // language should change
                    expect(doc.getLanguage()).toBe(html);
                    expect(spy).toHaveBeenCalled();
                    expect(spy.callCount).toEqual(1);
                    
                    // check callback args (arg 0 is a jQuery event)
                    expect(spy.mostRecentCall.args[1]).toBe(javascript);
                    expect(spy.mostRecentCall.args[2]).toBe(html);
                    
                    // cleanup
                    doc.releaseRef();
                });
                
                SpecRunnerUtils.closeTestWindow();
                
                SpecRunnerUtils.removeTempDirectory();
            });
 afterLast(function () {
     PreferencesManager = null;
     SpecRunnerUtils.closeTestWindow();
 });
Example #26
0
 this.after(function () {
     SpecRunnerUtils.closeTestWindow();
 });
 runs(function () {
     SpecRunnerUtils.closeTestWindow();
 });
 it("should close the test window", function () {
     testWindow = null;
     SpecRunnerUtils.closeTestWindow();
 });
 afterLast(function () {
     testWindow = null;
     SpecRunnerUtils.closeTestWindow();
 });