This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #268 from mcav/pop3-trash-connection
Bug 945669 - [email/POP3] Make FolderStorage.sliceOpenMostRecent not trigger connection establishment for POP3 folders other than the inbox; clean up tests. r=asuth
- Loading branch information
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Make sure POP3 only opens a connection for the inbox. | ||
**/ | ||
|
||
define(['rdcommon/testcontext', './resources/th_main', | ||
'wbxml', 'activesync/codepages', | ||
'exports'], | ||
function($tc, $th_main, $wbxml, $ascp, exports) { | ||
|
||
var TD = exports.TD = $tc.defineTestsFor( | ||
{ id: 'test_pop3_connection_use' }, null, | ||
[$th_main.TESTHELPER], ['app']); | ||
|
||
TD.commonCase('connection use', function(T, RT) { | ||
T.group('setup'); | ||
var testUniverse = T.actor('testUniverse', 'U'); | ||
var testAccount = T.actor('testAccount', 'A', { universe: testUniverse }); | ||
var eSync = T.lazyLogger('sync'); | ||
|
||
var trashFolder = testAccount.do_useExistingFolderWithType('trash', ''); | ||
var inboxFolder = testAccount.do_useExistingFolderWithType('inbox', ''); | ||
|
||
T.action('close existing connection', function() { | ||
testAccount.folderAccount._conn.disconnect(); | ||
}); | ||
|
||
// Trash must not create a connection. | ||
testAccount.do_openFolderView( | ||
'opens', trashFolder, | ||
{ count: 0, full: 0 }, | ||
{ top: true, bottom: true, grow: false, newCount: null }, | ||
{ | ||
expectFunc: function() { | ||
RT.reportActiveActorThisStep(testAccount.eFolderAccount); | ||
testAccount.eFolderAccount.ignore_saveAccountState(); | ||
} | ||
}); | ||
|
||
// Inbox must create a connection. | ||
testAccount.do_openFolderView( | ||
'opens', inboxFolder, | ||
{ count: 0, full: 0 }, | ||
{ top: true, bottom: true, grow: false, newCount: null }, | ||
{ syncedToDawnOfTime: true, | ||
expectFunc: function() { | ||
RT.reportActiveActorThisStep(testAccount.eFolderAccount); | ||
testAccount.eFolderAccount.expect_createConnection(); | ||
testAccount.eFolderAccount.ignore_saveAccountState(); | ||
} | ||
}); | ||
|
||
|
||
T.group('cleanup'); | ||
}); | ||
|
||
}); // end define |