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

Unified Diff: ui/file_manager/file_manager/background/js/import_history_unittest.js

Issue 867123007: Fix more tests in the import history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/background/js/import_history_unittest.js
diff --git a/ui/file_manager/file_manager/background/js/import_history_unittest.js b/ui/file_manager/file_manager/background/js/import_history_unittest.js
index 703cba2779fe1db1b34c4d593439aca53808703f..ca0f523c78bfca60f3f71d0067f4c59a21de5833 100644
--- a/ui/file_manager/file_manager/background/js/import_history_unittest.js
+++ b/ui/file_manager/file_manager/background/js/import_history_unittest.js
@@ -67,7 +67,7 @@ function testHistoryWasCopiedFalseForUnknownEntry(callback) {
// but not for this file.
testPromise = historyProvider.then(
function(history) {
- history.wasCopied(testFileEntry, SPACE_CAMP).then(assertFalse);
+ return history.wasCopied(testFileEntry, SPACE_CAMP).then(assertFalse);
});
reportPromise(testPromise, callback);
@@ -77,7 +77,7 @@ function testHistoryWasCopiedTrueForKnownEntryLoadedFromStorage(callback) {
// TestRecordWriter is pre-configured with this entry.
testPromise = historyProvider.then(
function(history) {
- history.wasCopied(testFileEntry, GOOGLE_DRIVE).then(assertTrue);
+ return history.wasCopied(testFileEntry, GOOGLE_DRIVE).then(assertTrue);
});
reportPromise(testPromise, callback);
@@ -86,9 +86,10 @@ function testHistoryWasCopiedTrueForKnownEntryLoadedFromStorage(callback) {
function testHistoryWasImportedTrueForKnownEntrySetAtRuntime(callback) {
testPromise = historyProvider.then(
function(history) {
- history.markImported(testFileEntry, SPACE_CAMP).then(
+ return history.markImported(testFileEntry, SPACE_CAMP).then(
function() {
- history.wasImported(testFileEntry, SPACE_CAMP).then(assertTrue);
+ return history.wasImported(testFileEntry, SPACE_CAMP)
+ .then(assertTrue);
});
});
@@ -99,7 +100,7 @@ function testHistoryWasCopiedTrueForKnownEntryLoadedFromStorage(callback) {
// TestRecordWriter is pre-configured with this entry.
testPromise = historyProvider.then(
function(history) {
- history.wasCopied(testFileEntry, GOOGLE_DRIVE).then(assertTrue);
+ return history.wasCopied(testFileEntry, GOOGLE_DRIVE).then(assertTrue);
});
reportPromise(testPromise, callback);
@@ -110,9 +111,9 @@ function testCopyChangeFiresChangedEvent(callback) {
function(history) {
var recorder = new TestCallRecorder();
history.addObserver(recorder.callback);
- history.markCopied(testFileEntry, SPACE_CAMP, 'url1').then(
+ return history.markCopied(testFileEntry, SPACE_CAMP, 'url1').then(
function() {
- Promise.resolve()
+ return Promise.resolve()
.then(
function() {
recorder.assertCallCount(1);
@@ -152,7 +153,7 @@ function testHistoryWasImportedFalseForUnknownEntry(callback) {
// but not for this file.
testPromise = historyProvider.then(
function(history) {
- history.wasImported(testFileEntry, SPACE_CAMP).then(assertFalse);
+ return history.wasImported(testFileEntry, SPACE_CAMP).then(assertFalse);
});
reportPromise(testPromise, callback);
@@ -162,7 +163,8 @@ function testHistoryWasImportedTrueForKnownEntryLoadedFromStorage(callback) {
// TestRecordWriter is pre-configured with this entry.
testPromise = historyProvider.then(
function(history) {
- history.wasImported(testFileEntry, GOOGLE_DRIVE).then(assertTrue);
+ return history.wasImported(testFileEntry, GOOGLE_DRIVE)
+ .then(assertTrue);
});
reportPromise(testPromise, callback);
@@ -171,9 +173,10 @@ function testHistoryWasImportedTrueForKnownEntryLoadedFromStorage(callback) {
function testHistoryWasImportedTrueForKnownEntrySetAtRuntime(callback) {
testPromise = historyProvider.then(
function(history) {
- history.markImported(testFileEntry, SPACE_CAMP).then(
+ return history.markImported(testFileEntry, SPACE_CAMP).then(
function() {
- history.wasImported(testFileEntry, SPACE_CAMP).then(assertTrue);
+ return history.wasImported(testFileEntry, SPACE_CAMP)
+ .then(assertTrue);
});
});
@@ -185,9 +188,9 @@ function testImportChangeFiresChangedEvent(callback) {
function(history) {
var recorder = new TestCallRecorder();
history.addObserver(recorder.callback);
- history.markImported(testFileEntry, SPACE_CAMP).then(
+ return history.markImported(testFileEntry, SPACE_CAMP).then(
function() {
- Promise.resolve()
+ return Promise.resolve()
.then(
function() {
recorder.assertCallCount(1);
@@ -211,9 +214,9 @@ function testHistoryObserverUnsubscribe(callback) {
var promises = [];
promises.push(history.markCopied(testFileEntry, SPACE_CAMP, 'url2'));
promises.push(history.markImported(testFileEntry, SPACE_CAMP));
- Promise.all(promises).then(
+ return Promise.all(promises).then(
function() {
- Promise.resolve()
+ return Promise.resolve()
.then(
function() {
recorder.assertCallCount(0);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698