webworks media tests

Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/2db5e4e8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/2db5e4e8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/2db5e4e8

Branch: refs/heads/master
Commit: 2db5e4e887ad612368019e554074de1b6df6e8f5
Parents: e1be8e7
Author: Matt Lantz <[email protected]>
Authored: Wed Nov 7 17:33:12 2012 -0500
Committer: Gord Tanner <[email protected]>
Committed: Mon Nov 12 09:42:28 2012 -0500

----------------------------------------------------------------------
 test/blackberry/webworks/test.media.js |   52 +++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/2db5e4e8/test/blackberry/webworks/test.media.js
----------------------------------------------------------------------
diff --git a/test/blackberry/webworks/test.media.js 
b/test/blackberry/webworks/test.media.js
new file mode 100644
index 0000000..6ef95a3
--- /dev/null
+++ b/test/blackberry/webworks/test.media.js
@@ -0,0 +1,52 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+describe("media", function () {
+    var media = require('cordova/plugin/webworks/media'),
+       exec = require('cordova/exec');
+    
+    describe("create", function() {
+
+        it("should fail to create a media object", function() {            
+            var m = media.create(8);
+
+               expect(m.status).toBe(9);
+               expect(m.message).toBe('Media Object id was not sent in 
arguments');
+        });
+
+        it("should create a media object", function() {            
+     
+               var Audio = jasmine.createSpy('Audio');
+               window.Audio = new Audio;
+
+               // spyOn(window, "Audio");
+
+               // var m = media.create(["jammin", "yeah man!"]);
+
+               // expect(window.Audio).toHaveBeenCalled();
+            
+               // expect(m.status).toBe(1);
+               // expect(m.message).toBe('Audio object created');
+        });
+    });
+
+
+});

Reply via email to