Commit 9b7961c2 authored by Findit's avatar Findit

Revert "Hide filename edit field when there is no image"

This reverts commit d270ec39.

Reason for revert:

Findit (https://goo.gl/kROfz5) identified CL at revision 596972 as the
culprit for flakes in the build cycles as shown on:
https://findit-for-me.appspot.com/waterfall/flake/flake-culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyQwsSDEZsYWtlQ3VscHJpdCIxY2hyb21pdW0vZDI3MGVjMzkwMmFmZTU4OTg4MjM0ODMyYjdjMzNmN2U1Y2U5MmFhNgw

Sample Failed Build: https://ci.chromium.org/buildbot/chromium.chromiumos/linux-chromeos-dbg/8178

Sample Failed Step: viz_browser_tests

Sample Flaky Test: GalleryBrowserTest.DeleteSingleOpenPhotoOnDownloads

Original change's description:
> Hide filename edit field when there is no image
> 
> Hide |filenameEdit_| line edit box when there is no image to be displayed.
> This fixes an undesired grey line appearing as the bottom of this edit box.
> Changing the "disabled" state doesn't change the style of this box,
> "disabled" state is only used for read-only behaviour not style.
> 
> R=fukino@chromium.org
> 
> Bug: 796503
> Change-Id: I6fc9a4eb218231781325ba7a5af992b12610b929
> Reviewed-on: https://chromium-review.googlesource.com/c/1212263
> Reviewed-by: Noel Gordon <noel@chromium.org>
> Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
> Commit-Queue: Alexander Nohe <nohe@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#596972}

Change-Id: I5a64c57351cc39d641af6052567c8f8d150542cc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 796503, 892543
Reviewed-on: https://chromium-review.googlesource.com/c/1263887
Cr-Commit-Position: refs/heads/master@{#597033}
parent 3e6b699a
...@@ -330,9 +330,4 @@ IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, ActivateVideoFromThumbnailMode) { ...@@ -330,9 +330,4 @@ IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, ActivateVideoFromThumbnailMode) {
StartTest(); StartTest();
} }
IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, DeleteSingleOpenPhotoOnDownloads) {
set_test_case_name("deleteSingleOpenPhotoOnDownloads");
StartTest();
}
} // namespace file_manager } // namespace file_manager
...@@ -814,9 +814,6 @@ Gallery.prototype.updateSelectionAndState_ = function() { ...@@ -814,9 +814,6 @@ Gallery.prototype.updateSelectionAndState_ = function() {
selectedItem.touch(); selectedItem.touch();
this.dataModel_.evictCache(); this.dataModel_.evictCache();
// Filename Edit field shows for anything selected.
this.filenameEdit_.hidden = false;
// Update the title and the display name. // Update the title and the display name.
if (numSelectedItems === 1) { if (numSelectedItems === 1) {
document.title = this.selectedEntry_.name; document.title = this.selectedEntry_.name;
...@@ -844,7 +841,6 @@ Gallery.prototype.updateSelectionAndState_ = function() { ...@@ -844,7 +841,6 @@ Gallery.prototype.updateSelectionAndState_ = function() {
} }
} else { } else {
document.title = ''; document.title = '';
this.filenameEdit_.hidden = true;
this.filenameEdit_.disabled = true; this.filenameEdit_.disabled = true;
this.filenameEdit_.value = ''; this.filenameEdit_.value = '';
this.resizeRenameField_(); this.resizeRenameField_();
...@@ -1104,4 +1100,4 @@ if (document.readyState === 'loading') { ...@@ -1104,4 +1100,4 @@ if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initializeGallery); document.addEventListener('DOMContentLoaded', initializeGallery);
} else { } else {
initializeGallery(); initializeGallery();
} }
\ No newline at end of file
...@@ -161,29 +161,3 @@ testcase.openMultipleImagesOnDrive = function() { ...@@ -161,29 +161,3 @@ testcase.openMultipleImagesOnDrive = function() {
testcase.openMultipleImagesAndChangeToSlideModeOnDownloads = function() { testcase.openMultipleImagesAndChangeToSlideModeOnDownloads = function() {
return openMultipleImagesAndChangeToSlideMode('local', 'downloads'); return openMultipleImagesAndChangeToSlideMode('local', 'downloads');
}; };
/**
* Runs a test to check whether the rename-input field is hidden after
* deleting the only selected image in the gallery.
* @return {Promise} Promise to be fulfilled with on success.
*/
testcase.deleteSingleOpenPhotoOnDownloads = function() {
const launchedPromise = launch('local', 'downloads', [ENTRIES.desktop]);
return launchedPromise.then(function(args) {
const appId = args.appId;
return gallery.waitForElement(appId, 'button.delete')
.then(function() {
// Click the delete button.
return gallery.waitAndClickElement(appId, 'button.delete');
})
.then(function(result) {
chrome.test.assertTrue(!!result);
// Wait and click delete button of confirmation dialog.
return gallery.waitAndClickElement(appId, '.cr-dialog-ok');
})
.then(function() {
// Check: The edit name field should hide.
return gallery.waitForElement(appId, '#rename-input[hidden]');
});
});
};
\ No newline at end of file
...@@ -118,9 +118,6 @@ function deleteAllImagesInThumbnailMode(testVolumeName, volumeType, operation) { ...@@ -118,9 +118,6 @@ function deleteAllImagesInThumbnailMode(testVolumeName, volumeType, operation) {
chrome.test.assertTrue(!!result); chrome.test.assertTrue(!!result);
// Wait until error banner is shown. // Wait until error banner is shown.
return gallery.waitForElement(appId, '.gallery[error] .error-banner'); return gallery.waitForElement(appId, '.gallery[error] .error-banner');
}).then(function() {
// Check: The edit name field should hide.
return gallery.waitForElement(appId, '#rename-input[hidden]');
}); });
} }
...@@ -163,9 +160,6 @@ function emptySpaceClickUnselectsInThumbnailMode(testVolumeName, volumeType) { ...@@ -163,9 +160,6 @@ function emptySpaceClickUnselectsInThumbnailMode(testVolumeName, volumeType) {
}).then(function(result) { }).then(function(result) {
// Confirm slideshow button is disabled. // Confirm slideshow button is disabled.
return gallery.waitForElement(appId, 'button.slideshow[disabled]'); return gallery.waitForElement(appId, 'button.slideshow[disabled]');
}).then(function() {
// Check: The edit name field should hide.
return gallery.waitForElement(appId, '#rename-input[hidden]');
}).then(function() { }).then(function() {
// Switch back to slide mode by clicking mode button. // Switch back to slide mode by clicking mode button.
return gallery.waitAndClickElement(appId, 'button.mode:not([disabled])'); return gallery.waitAndClickElement(appId, 'button.mode:not([disabled])');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment