Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / feedback_private / basic / test.js
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 chrome.test.runTests([
6   function getUserEmailTest() {
7     chrome.feedbackPrivate.getUserEmail(
8         chrome.test.callbackPass(function(email) {
9       if (email.length > 0) {
10         // If we actually have an e-mail address returned, do a simple sanity
11         // check on it.
12         chrome.test.assertTrue(email.indexOf('@') != -1);
13       }
14     }));
15   },
16   function getSystemInfoTest() {
17     chrome.feedbackPrivate.getSystemInformation(
18         chrome.test.callbackPass(function(sysinfo) {
19       // Make sure we get 'some' system info.
20       chrome.test.assertTrue(sysinfo.length >= 1);
21     }));
22   },
23   function sendFeedbackTest() {
24     var feedbackInfo = {
25       description: 'This is a test description',
26       sendHistograms: false
27     };
28     chrome.feedbackPrivate.sendFeedback(
29         feedbackInfo, chrome.test.callbackPass(function(response) {
30       chrome.test.assertEq(response, 'success');
31     }));
32   }
33 ]);