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

Side by Side Diff: chrome/test/data/webui/md_bookmarks/edit_dialog_test.js

Issue 2769103002: MD Bookmarks: Save and close bookmark edit dialog on 'enter' key press. (Closed)
Patch Set: Closure Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/md_bookmarks/edit_dialog.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 suite('<bookmarks-edit-dialog>', function() { 5 suite('<bookmarks-edit-dialog>', function() {
6 var dialog; 6 var dialog;
7 var lastUpdate; 7 var lastUpdate;
8 8
9 suiteSetup(function() { 9 suiteSetup(function() {
10 chrome.bookmarks.update = function(id, edit) { 10 chrome.bookmarks.update = function(id, edit) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 var folder = createFolder('2', [], {title: 'Cool Sites'}); 48 var folder = createFolder('2', [], {title: 'Cool Sites'});
49 dialog.showEditDialog(folder); 49 dialog.showEditDialog(folder);
50 dialog.titleValue_ = 'Awesome websites'; 50 dialog.titleValue_ = 'Awesome websites';
51 51
52 MockInteractions.tap(dialog.$.saveButton); 52 MockInteractions.tap(dialog.$.saveButton);
53 53
54 assertEquals(folder.id, lastUpdate.id); 54 assertEquals(folder.id, lastUpdate.id);
55 assertEquals(undefined, lastUpdate.edit.url); 55 assertEquals(undefined, lastUpdate.edit.url);
56 assertEquals('Awesome websites', lastUpdate.edit.title); 56 assertEquals('Awesome websites', lastUpdate.edit.title);
57 }); 57 });
58
59 test('pressing enter saves and closes dialog', function() {
60 var item = createItem('1', {url: 'http://www.example.com'});
61 dialog.showEditDialog(item);
62
63 MockInteractions.pressEnter(dialog.$.url);
64 assertFalse(dialog.$.dialog.open);
65 });
58 }); 66 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/edit_dialog.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698