Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

[REVIEW ONLY] Split View Refactoring #8045

Closed
wants to merge 78 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
4dadcb3
Merge branch 'master' of https://github.com/adobe/brackets
JeffryBooher Apr 5, 2014
e99c6ee
initial checkin
JeffryBooher May 15, 2014
3d0092e
rename panel manager
JeffryBooher May 16, 2014
ede4942
WorkingSetView => PaneListView
JeffryBooher May 19, 2014
beec3fa
workingsetsort -> panelistsort, panelistview -> panelistview
JeffryBooher May 20, 2014
d17d923
resolve conflicts
JeffryBooher May 20, 2014
61bef43
refactor sort command handler
JeffryBooher May 21, 2014
51c0894
rename automaticSort
JeffryBooher May 21, 2014
3cda537
workingSet -> paneList renames
JeffryBooher May 21, 2014
3628f6f
rename FILE.ADD_TO_WORKINGSET
JeffryBooher May 21, 2014
243f1de
rename working set command
JeffryBooher May 21, 2014
3749812
SORT_WORKINGSET_AUTO => SORT_PANEWLIST_AUTO
JeffryBooher May 21, 2014
703b9b1
cleanup/deprecate workingSetSort commands
JeffryBooher May 22, 2014
cf2e104
update strings
JeffryBooher May 22, 2014
4e52024
formatting
JeffryBooher May 22, 2014
2bbf790
rename working set menus
JeffryBooher May 22, 2014
9420ecd
string change
JeffryBooher May 22, 2014
de1d7f7
start moving working set apis
JeffryBooher May 22, 2014
c88d71f
first api successfully migrated
JeffryBooher May 23, 2014
129ec66
fix reset and a few other things. All tests passing
JeffryBooher May 23, 2014
52c0dd4
deprecate events
JeffryBooher May 23, 2014
e30121a
paneview -> paneListView
JeffryBooher May 23, 2014
df70d5e
cleanup and doc
JeffryBooher May 24, 2014
4787f80
move removeApis, fix a few issues
JeffryBooher May 24, 2014
919314d
move more removeApis, fix issues
JeffryBooher May 24, 2014
863eba4
move workingsetsort
JeffryBooher May 24, 2014
5abf892
paneListView drag&drop, sort events
JeffryBooher May 24, 2014
33d5ed6
paneListView traversing
JeffryBooher May 24, 2014
0714cf6
refactor notifyPathDeleted
JeffryBooher May 24, 2014
8269392
panelist serialization
JeffryBooher May 24, 2014
fad6511
move editor events into MainViewManager
JeffryBooher May 24, 2014
1082ee7
first change successful
JeffryBooher May 27, 2014
3e54f88
wip:working
JeffryBooher May 27, 2014
3a4b246
wip:more working
JeffryBooher May 27, 2014
3f0d5cc
cleanup
JeffryBooher May 27, 2014
302937e
final fixes and cleanup
JeffryBooher May 27, 2014
c257052
on more final cleanup
JeffryBooher May 27, 2014
dec81ef
Merge pull request #7942 from adobe/jeff/splitview-cd2
JeffryBooher May 27, 2014
503c03a
merge with master
JeffryBooher May 27, 2014
f781944
merge with master
JeffryBooher May 27, 2014
d268ce6
fix autosort on startup
JeffryBooher May 27, 2014
21ca74c
deprecating WorkingSetView and PanelManager in favor of new MainViewM…
bchintx May 30, 2014
fcf1996
next pass at deprecating API calls
bchintx May 30, 2014
66cd45b
deprecating a few more API calls based on a Find in Files search
bchintx May 30, 2014
65cf5f5
removing extra require statement
bchintx May 30, 2014
f64eada
merge with master
JeffryBooher Jun 2, 2014
0a1c18c
deprecate PanelManager.createBottomPanel
JeffryBooher Jun 2, 2014
cc908aa
fix lint and warn once
JeffryBooher Jun 2, 2014
36308f8
fix test failures
JeffryBooher Jun 2, 2014
4e980bd
fix close others test failure
JeffryBooher Jun 2, 2014
eb9cb9d
fix deprecation warning
JeffryBooher Jun 2, 2014
cd5464d
migrate sort pref / fix type sort
JeffryBooher Jun 3, 2014
d4674a6
update test
JeffryBooher Jun 3, 2014
f7f3e59
update test
JeffryBooher Jun 3, 2014
fae4177
Remove scaffolding stubs and Deprecated APIs that aren't used accordi…
JeffryBooher Jun 3, 2014
f04df19
re-add removeListFromWorkingSet used by newly added vim extension
JeffryBooher Jun 3, 2014
681a027
fix broken menus and panels for extensions
JeffryBooher Jun 4, 2014
f810efc
lint
JeffryBooher Jun 4, 2014
e9a483f
adding PaneViewListSort unit tests
bchintx Jun 4, 2014
d44ad46
cleanup
JeffryBooher Jun 4, 2014
32fe3f4
Merge branch 'jeff/splitview-merge' of https://github.com/adobe/brack…
JeffryBooher Jun 4, 2014
31cce39
solve legacy event order dependency for eextensions
JeffryBooher Jun 4, 2014
adfa5f5
fixes and changes from self review
JeffryBooher Jun 5, 2014
2ec8d36
merge with master
JeffryBooher Jun 5, 2014
d6c9036
roll language changes back
JeffryBooher Jun 5, 2014
11c54ea
formatting
JeffryBooher Jun 5, 2014
dc3a2f8
add 'EXTENSIONS_READY appInit so deprecated events can be registered,…
JeffryBooher Jun 5, 2014
6c32741
update docs
JeffryBooher Jun 5, 2014
f792ef9
RTC:Fix some jsDoc stuff
JeffryBooher Jun 5, 2014
9e68817
fixes lint
JeffryBooher Jun 5, 2014
751684d
fix command handler
JeffryBooher Jun 9, 2014
b56e852
respond to comments
JeffryBooher Jun 10, 2014
6b338d0
more JSDoc fixes
JeffryBooher Jun 10, 2014
f65f1f5
more JSDoc fixes
JeffryBooher Jun 10, 2014
1f9cae7
update jsdoc
JeffryBooher Jun 10, 2014
62032a2
update
JeffryBooher Jun 10, 2014
0157d11
unit test upgrades
JeffryBooher Jun 11, 2014
bff8717
one more test for close others extension
JeffryBooher Jun 11, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/UnitTestSuite.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ define(function (require, exports, module) {
//require("spec/ViewCommandHandlers-test");
require("spec/ViewUtils-test");
require("spec/PaneViewListView-test");
require("spec/PaneViewListSort-test");
});
200 changes: 200 additions & 0 deletions test/spec/PaneViewListSort-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
/*
* Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/


/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, maxerr: 50 */
/*global $, define, describe, it, expect, waitsFor, runs, beforeFirst, afterLast */

define(function (require, exports, module) {
"use strict";

var CommandManager, // Load from brackets.test
Commands, // Load from brackets.test
DocumentManager, // Load from brackets.test
FileViewController, // Load from brackets.test
MainViewManager, // Load from brackets.test
SpecRunnerUtils = require("spec/SpecRunnerUtils");


describe("PaneViewListSort", function () {

this.category = "integration";

var testPath = SpecRunnerUtils.getTestPath("/spec/PaneViewListView-test-files"),
testWindow,
workingSetCount = 0;

function openAndMakeDirty(path) {
var doc, didOpen = false, gotError = false;

// open file
runs(function () {
FileViewController.openAndSelectDocument(path, FileViewController.PROJECT_MANAGER)
.done(function () { didOpen = true; })
.fail(function () { gotError = true; });
});
waitsFor(function () { return didOpen && !gotError; }, "FILE_OPEN on file timeout", 1000);

// change editor content to make doc dirty which adds it to the working set
runs(function () {
doc = DocumentManager.getCurrentDocument();
doc.setText("dirty document");
});
}

function createTestWindow(spec, loadProject) {
SpecRunnerUtils.createTestWindowAndRun(spec, function (w) {
testWindow = w;

// Load module instances from brackets.test
CommandManager = testWindow.brackets.test.CommandManager;
Commands = testWindow.brackets.test.Commands;
DocumentManager = testWindow.brackets.test.DocumentManager;
FileViewController = testWindow.brackets.test.FileViewController;
MainViewManager = testWindow.brackets.test.MainViewManager;

// Open a directory
if (loadProject) {
SpecRunnerUtils.loadProjectInTestWindow(testPath);
}
});

runs(function () {
// Initialize: register listeners
testWindow.$(MainViewManager).on("paneViewListAdd", function (event, addedFile) {
workingSetCount++;
});
});
}

function closeTestWindow() {
testWindow = null;
CommandManager = null;
Commands = null;
DocumentManager = null;
FileViewController = null;
SpecRunnerUtils.closeTestWindow();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing:

    MainViewManager = null;

}

beforeFirst(function () {
createTestWindow(this, true);

workingSetCount = 0;

openAndMakeDirty(testPath + "/file_four.html");
openAndMakeDirty(testPath + "/file_zero.css");
openAndMakeDirty(testPath + "/file_two.js");

// Wait for both files to be added to the working set
waitsFor(function () { return workingSetCount === 3; }, "workingSetCount to equal 3", 1000);
});

afterLast(function () {
testWindow.closeAllFiles();
closeTestWindow();
});

it("should sort list by name", function () {
// sort list by name
CommandManager.execute(Commands.CMD_SORT_PANE_VIEW_LIST_BY_NAME);

// confirm files sorted correctly
var $listItems = testWindow.$("#open-files-container > ul").children();
expect($listItems.length).toBe(workingSetCount);
expect($listItems.find("a").get(0).text === "file_four.html").toBeTruthy();
expect($listItems.find("a").get(1).text === "file_two.js").toBeTruthy();
expect($listItems.find("a").get(2).text === "file_zero.css").toBeTruthy();
expect($listItems.find(".file-status-icon").length).toBe(workingSetCount);
});

it("should sort list as added", function () {
// sort list as added
CommandManager.execute(Commands.CMD_SORT_PANE_VIEW_LIST_BY_ADDED);

// confirm files sorted correctly
var $listItems = testWindow.$("#open-files-container > ul").children();
expect($listItems.length).toBe(workingSetCount);
expect($listItems.find("a").get(0).text === "file_two.js").toBeTruthy();
expect($listItems.find("a").get(1).text === "file_zero.css").toBeTruthy();
expect($listItems.find("a").get(2).text === "file_four.html").toBeTruthy();
expect($listItems.find(".file-status-icon").length).toBe(workingSetCount);
});

it("should sort list by type", function () {
// sort list by type
CommandManager.execute(Commands.CMD_SORT_PANE_VIEW_LIST_BY_TYPE);

// confirm files sorted correctly
var $listItems = testWindow.$("#open-files-container > ul").children();
expect($listItems.length).toBe(workingSetCount);
expect($listItems.find("a").get(0).text === "file_zero.css").toBeTruthy();
expect($listItems.find("a").get(1).text === "file_four.html").toBeTruthy();
expect($listItems.find("a").get(2).text === "file_two.js").toBeTruthy();
expect($listItems.find(".file-status-icon").length).toBe(workingSetCount);
});

it("should sort list by type automatically", function () {
// toggle the auto sort on
CommandManager.execute(Commands.CMD_TOGGLE_AUTO_SORT);

// open another file, which should be added and auto-sorted into the list
openAndMakeDirty(testPath + "/file_one.js");

waitsFor(function () { return workingSetCount === 4; }, "workingSetCount to equal 4", 5000);

runs(function () {
// confirm files sorted correctly
var $listItems = testWindow.$("#open-files-container > ul").children();
expect($listItems.length).toBe(workingSetCount);
expect($listItems.find("a").get(0).text === "file_zero.css").toBeTruthy();
expect($listItems.find("a").get(1).text === "file_four.html").toBeTruthy();
expect($listItems.find("a").get(2).text === "file_one.js").toBeTruthy();
expect($listItems.find("a").get(3).text === "file_two.js").toBeTruthy();
expect($listItems.find(".file-status-icon").length).toBe(workingSetCount);
});
});

it("should not sort list by type automatically", function () {
// toggle the auto sort off
CommandManager.execute(Commands.CMD_TOGGLE_AUTO_SORT);

// open another file, which should not be added and auto-sorted into the list
openAndMakeDirty(testPath + "/file_three.js");

waitsFor(function () { return workingSetCount === 5; }, "workingSetCount to equal 5", 5000);

runs(function () {
// confirm files sorted correctly
var $listItems = testWindow.$("#open-files-container > ul").children();
expect($listItems.length).toBe(workingSetCount);
expect($listItems.find("a").get(0).text === "file_zero.css").toBeTruthy();
expect($listItems.find("a").get(1).text === "file_four.html").toBeTruthy();
expect($listItems.find("a").get(2).text === "file_one.js").toBeTruthy();
expect($listItems.find("a").get(3).text === "file_two.js").toBeTruthy();
expect($listItems.find("a").get(4).text === "file_three.js").toBeTruthy();
expect($listItems.find(".file-status-icon").length).toBe(workingSetCount);
});
});

});
});
Empty file.
Empty file.