Index: appengine/chromium_rietveld/new_static/model/tests/patch_set_tests.js |
diff --git a/appengine/chromium_rietveld/new_static/model/tests/patch_set_tests.js b/appengine/chromium_rietveld/new_static/model/tests/patch_set_tests.js |
index b2e3792dff441a5b8a7cdf37e214b7fe403b799c..90bb94b86a6ece13bbc04fb7e21a61cb989f379d 100644 |
--- a/appengine/chromium_rietveld/new_static/model/tests/patch_set_tests.js |
+++ b/appengine/chromium_rietveld/new_static/model/tests/patch_set_tests.js |
@@ -3,44 +3,90 @@ |
describe("PatchSet", function() { |
var assert = chai.assert; |
- it("should sort headers before implementation files", function() { |
+ function assertSortedNames(inputNames, sortedNames) { |
+ var files = {}; |
+ inputNames.forEach(function(name) { |
+ files[name] = {}; |
+ }); |
var patchset = new PatchSet(new Issue(1), 2); |
patchset.parseData({ |
issue: 1, |
patchset: 2, |
- files: { |
- "Source/rendering/FrameView.h": {}, |
- "Source/frame/Frame.cpp": {}, |
- "Source/core/Document.cpp": {}, |
- "LayoutTests/foo/bar.js": {}, |
- "Source/core/DocumentImplementation.h": {}, |
- "Source/frame/Frame.h": {}, |
- "LayoutTests/foo/bar.html": {}, |
- "Source/rendering/FrameView.cpph": {}, |
- "Source/rendering/FrameView.cpp": {}, |
- "public/rendering/FrameView.cpp": {}, |
- "LayoutTests/foo/ack.html": {}, |
- "Source/rendering/FrameView.html": {}, |
- "Source/core/Document.h": {}, |
- }, |
+ files: files, |
}); |
- var fileNames = patchset.files.map(function(file) { |
+ var actualNames = patchset.files.map(function(file) { |
return file.name; |
}); |
- assert.deepEqual(fileNames, [ |
+ assert.deepEqual(actualNames, sortedNames); |
+ } |
+ |
+ it("should sort headers before implementation files", function() { |
+ assertSortedNames([ |
+ "Source/rendering/FrameView.hpp", |
+ "Source/frame/Frame.cpp", |
+ "Source/core/Document.cpp", |
+ "LayoutTests/foo/bar.js", |
+ "Source/core/DocumentImplementation.h", |
+ "Source/frame/Frame.h", |
+ "LayoutTests/foo/bar.html", |
+ "Source/rendering/FrameView.cpph", |
+ "Source/rendering/FrameView.cpp", |
+ "public/rendering/FrameView.cpp", |
+ "LayoutTests/foo/ack.html", |
+ "LayoutTests/foo/bar.hxx", |
+ "Source/rendering/FrameView.html", |
+ "Source/core/Document.h", |
+ ], [ |
"public/rendering/FrameView.cpp", |
"Source/core/Document.h", |
"Source/core/Document.cpp", |
"Source/core/DocumentImplementation.h", |
"Source/frame/Frame.h", |
"Source/frame/Frame.cpp", |
- "Source/rendering/FrameView.cpph", |
- "Source/rendering/FrameView.h", |
+ "Source/rendering/FrameView.hpp", |
"Source/rendering/FrameView.cpp", |
+ "Source/rendering/FrameView.cpph", |
"Source/rendering/FrameView.html", |
"LayoutTests/foo/ack.html", |
"LayoutTests/foo/bar.html", |
+ "LayoutTests/foo/bar.h", |
"LayoutTests/foo/bar.js", |
]); |
}); |
+ |
+ it.only("should sort files without extensions", function() { |
+ assertSortedNames([ |
+ "chrome/chrome_tests_unit.gypi", |
+ "components/webdata/DEPS", |
+ "components/webdata_services/DEPS", |
+ "components/components.gyp", |
+ "chrome/browser/sync/profile_sync_service_autofill_unittest.a", |
+ "components/webdata_services/web_data_service_test_util.cc", |
+ "chrome/browser/BUILD.gn", |
+ "components/webdata_services/web_data_service_wrapper.cc", |
+ "components/webdata_services/web_data_service_test_util.h", |
+ "components/OWNERS", |
+ "components/autofill/core/browser/DEPS", |
+ "components/webdata/common/web_data_service_test_util.cc", |
+ "chrome/browser/DEPS", |
+ "components/webdata_services/BUILD.gn", |
+ "chrome/browser/webdata/web_data_service_factory.h", |
+ ], [ |
+ "chrome/browser/BUILD.gn", |
+ "chrome/browser/DEPS", |
+ "chrome/browser/sync/profile_sync_service_autofill_unittest.a", |
+ "chrome/browser/webdata/web_data_service_factory.h", |
+ "chrome/chrome_tests_unit.gypi", |
+ "components/autofill/core/browser/DEPS", |
+ "components/components.gyp", |
+ "components/OWNERS", |
+ "components/webdata_services/BUILD.gn", |
+ "components/webdata_services/DEPS", |
+ "components/webdata_services/web_data_service_test_util.h", |
+ "components/webdata_services/web_data_service_test_util.cc", |
+ "components/webdata_services/web_data_service_wrapper.cc", |
+ "components/webdata/common/web_data_service_test_util.cc", |
+ "components/webdata/DEPS", |
+ ]); |
+ }); |
}); |