Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: appengine/chromium_rietveld/new_static/diff/diff_parser_tests.js

Issue 904253002: Support more than just png files for diff images. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/chromium_rietveld/new_static/diff/diff_parser.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/chromium_rietveld/new_static/diff/diff_parser_tests.js
diff --git a/appengine/chromium_rietveld/new_static/diff/diff_parser_tests.js b/appengine/chromium_rietveld/new_static/diff/diff_parser_tests.js
index cf12a03b72dc8ae689119ed97891109c1aec7aad..8e777b6eba45dfc3dc9bc4abf3dcd2a4a522ab7e 100644
--- a/appengine/chromium_rietveld/new_static/diff/diff_parser_tests.js
+++ b/appengine/chromium_rietveld/new_static/diff/diff_parser_tests.js
@@ -5,6 +5,16 @@
"use strict";
describe("DiffParser", function() {
+ it("should detect image file names", function() {
+ expect(DiffParser.isImageFile("foo.png")).toBeTruthy();
+ expect(DiffParser.isImageFile("foo.bar.jpeg")).toBeTruthy();
+ expect(DiffParser.isImageFile("foo(baz).jpg")).toBeTruthy();
+ expect(DiffParser.isImageFile("_foo_.webp")).toBeTruthy();
+ expect(DiffParser.isImageFile("example-file-name.bmp")).toBeTruthy();
+ expect(DiffParser.isImageFile("is a. gif.gif")).toBeTruthy();
+ expect(DiffParser.isImageFile(".gif")).toBeFalsy();
+ expect(DiffParser.isImageFile("not a gif.gif.txt")).toBeFalsy();
+ });
it("should not show context link for file deletes", function() {
var text =
"Index: example.cc\n" +
« no previous file with comments | « appengine/chromium_rietveld/new_static/diff/diff_parser.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698