mpviewplugins/mpdetailsviewplugin/tsrc/unittest_resources/test-src/MusicTest.js
changeset 47 4cc1412daed0
parent 45 612c4815aebe
child 51 560ce2306a17
equal deleted inserted replaced
45:612c4815aebe 47:4cc1412daed0
     1 MusicTest = TestCase('MusicTest');
       
     2 
       
     3 MusicTest.prototype.testMusicContext = function() {
       
     4     var context = music.privateFunctions.getMusicContext();
       
     5 	assertTrue(context.object.data.miniview.indexOf("London Calling") != -1);
       
     6 	assertTrue(context.object.data.miniview.indexOf("The Clash") != -1);
       
     7 };
       
     8 
       
     9 MusicTest.prototype.testNoa = function() {
       
    10     var context = music.privateFunctions.getNoa();
       
    11     assertTrue(context.username.indexOf("lcoubert10") != -1);
       
    12     assertTrue(context.password.indexOf("lcoubert01") != -1);
       
    13 };
       
    14 
       
    15 MusicTest.prototype.testInitPlayer = function() {
       
    16 //    document.createElement('div').setAttribute("id", "ovi.player.share.ui");
       
    17     /*:DOC += <div id="ovi.player.share.ui"></div>*/
       
    18     music.initPlayer();
       
    19 	var ui = document.getElementById("ovi.player.share.ui");
       
    20     assertTrue(ui.innerHTML.indexOf('player') >= 0);
       
    21 };
       
    22 
       
    23 MusicTest.prototype.setUp = function() {
       
    24     window.context = {
       
    25         username: function(){
       
    26             return "lcoubert10"
       
    27         },
       
    28         password: function(){
       
    29             return "lcoubert01"
       
    30         },
       
    31         title: function(){
       
    32             return "London Calling"
       
    33         },
       
    34         album: function(){
       
    35             return "dummyuri"
       
    36         },
       
    37         artist: function(){
       
    38             return "The Clash"
       
    39         },
       
    40         link: function(){
       
    41             return "http://music.ovi.com/ru/ru/pc/Product/Queen/Bohemian-Rhapsody/8019069"
       
    42         },
       
    43         albumArtBase64: function(){return 0;}
       
    44     }
       
    45 };
       
    46 
       
    47 MusicTest.prototype.tearDown = function() { };
       
    48 
       
    49