<script>

var assertFalse = chrome.test.assertFalse;
var assertTrue = chrome.test.assertTrue;
var pass = chrome.test.callbackPass;

var NO_TABS_PERMISSION =
    "You do not have permission to use 'windows.getAll'.";

chrome.test.runTests([
  function denyRequest() {
    chrome.experimental.permissions.request(
      {permissions: ['tabs']},
      pass(function(granted) {
        // They were not granted, and there should be no error.
        assertFalse(granted);
        assertTrue(chrome.extension.lastError === undefined);

        // Make sure they weren't granted...
        chrome.experimental.permissions.contains(
          {permissions: ['tabs']},
          pass(function(result) {
            assertFalse(result);
        }));

        try {
          chrome.windows.getAll({populate: true}, function() {
            chrome.test.fail("Should not have tabs API permission.");
          });
        } catch (e) {
          assertTrue(e.message.indexOf(NO_TABS_PERMISSION) == 0);
        }
    }));
  }
]);
</script>

<script>

var assertFalse = chrome.test.assertFalse;
var assertTrue = chrome.test.assertTrue;
var pass = chrome.test.callbackPass;

var NO_TABS_PERMISSION =
    "You do not have permission to use 'windows.getAll'.";

chrome.test.runTests([
  function denyRequest() {
    chrome.experimental.permissions.request(
      {permissions: ['tabs']},
      pass(function(granted) {
        // They were not granted, and there should be no error.
        assertFalse(granted);
        assertTrue(chrome.extension.lastError === undefined);

        // Make sure they weren't granted...
        chrome.experimental.permissions.contains(
          {permissions: ['tabs']},
          pass(function(result) {
            assertFalse(result);
        }));

        try {
          chrome.windows.getAll({populate: true}, function() {
            chrome.test.fail("Should not have tabs API permission.");
          });
        } catch (e) {
          assertTrue(e.message.indexOf(NO_TABS_PERMISSION) == 0);
        }
    }));
  }
]);
</script>

Remove CRLFs from extension test files.
Remove CRLFs from extension test files.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/7541041

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@95614 0039d316-1c4b-4281-b951-d872f2087c98
