function testOpenSuggestAppsDialogWithMetadata(callback) {
  var showByExtensionAndMimeIsCalled = new Promise(function(resolve, reject) {
    var fileSystem = new MockFileSystem('volumeId');
    var entry = new MockFileEntry(fileSystem, '/test.rtf');

    FileTasks
        .create(
            {
              getDriveConnectionState: function() {
                return VolumeManagerCommon.DriveConnectionType.ONLINE;
              }
            },
            {}, {}, {
              taskMenuButton: document.createElement('button'),
              fileContextMenu:
                  {defaultActionMenuItem: document.createElement('div')},
              suggestAppsDialog: {
                showByExtensionAndMime: function(
                    extension, mimeType, onDialogClosed) {
                  assertEquals('.rtf', extension);
                  assertEquals('application/rtf', mimeType);
                  resolve();
                }
              }
            },
            [entry], ['application/rtf'], mockTaskHistory)
        .then(function(tasks) {
          tasks.openSuggestAppsDialog(
              function() {}, function() {}, function() {});
        });
  });

  reportPromise(showByExtensionAndMimeIsCalled, callback);
}
/**
 * Test case for openSuggestAppsDialog with an entry which has external type of
 * metadata.
 */
Test case for openSuggestAppsDialog with an entry which has external type of
metadata.
Test case for openSuggestAppsDialog with an entry which has external type of metadata .
function testOpenSuggestAppsDialogWithMetadata(callback) {
  var showByExtensionAndMimeIsCalled = new Promise(function(resolve, reject) {
    var fileSystem = new MockFileSystem('volumeId');
    var entry = new MockFileEntry(fileSystem, '/test.rtf');
    FileTasks
        .create(
            {
              getDriveConnectionState: function() {
                return VolumeManagerCommon.DriveConnectionType.ONLINE;
              }
            },
            {}, {}, {
              taskMenuButton: document.createElement('button'),
              fileContextMenu:
                  {defaultActionMenuItem: document.createElement('div')},
              suggestAppsDialog: {
                showByExtensionAndMime: function(
                    extension, mimeType, onDialogClosed) {
                  assertEquals('.rtf', extension);
                  assertEquals('application/rtf', mimeType);
                  resolve();
                }
              }
            },
            [entry], ['application/rtf'], mockTaskHistory)
        .then(function(tasks) {
          tasks.openSuggestAppsDialog(
              function() {}, function() {}, function() {});
        });
  });
  reportPromise(showByExtensionAndMimeIsCalled, callback);
}
function testOpenSuggestAppsDialogWithMetadata ( callback ) { var showByExtensionAndMimeIsCalled = new Promise ( function ( resolve , reject ) { var fileSystem = new MockFileSystem ( 'volumeId' ) ; var entry = new MockFileEntry ( fileSystem , '/test.rtf' ) ; FileTasks . create ( { getDriveConnectionState : function ( ) { return VolumeManagerCommon . DriveConnectionType . ONLINE ; } } , { } , { } , { taskMenuButton : document . createElement ( 'button' ) , fileContextMenu : { defaultActionMenuItem : document . createElement ( 'div' ) } , suggestAppsDialog : { showByExtensionAndMime : function ( extension , mimeType , onDialogClosed ) { assertEquals ( '.rtf' , extension ) ; assertEquals ( 'application/rtf' , mimeType ) ; resolve ( ) ; } } } , [ entry ] , [ 'application/rtf' ] , mockTaskHistory ) . then ( function ( tasks ) { tasks . openSuggestAppsDialog ( function ( ) { } , function ( ) { } , function ( ) { } ) ; } ) ; } ) ; reportPromise ( showByExtensionAndMimeIsCalled , callback ) ; }
Test case for openSuggestAppsDialog with an entry which has external type of
 metadata.
Test case for openSuggestAppsDialog with an entry which has external type of metadata .