| OLD | NEW |
| 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 Loading... |
| 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 }); |
| OLD | NEW |