{"size": 1029, "ext": "js", "max_stars_repo_path": "chrome/test/data/extensions/api_test/permissions/always_allowed/background.js", "max_stars_repo_name": "zealoussnow/chromium", "max_stars_repo_stars_event_min_datetime": "2015-01-01T01:57:10.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T23:33:32.000Z", "max_issues_repo_path": "chrome/test/data/extensions/api_test/permissions/always_allowed/background.js", "max_issues_repo_name": "1065672644894730302/Chromium", "max_issues_repo_issues_event_min_datetime": "2020-04-18T08:22:18.000Z", "max_issues_repo_issues_event_max_datetime": "2021-12-08T13:04:49.000Z", "max_forks_repo_path": "chrome/test/data/extensions/api_test/permissions/always_allowed/background.js", "max_forks_repo_name": "1065672644894730302/Chromium", "max_forks_repo_forks_event_min_datetime": "2015-01-02T11:32:21.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T16:35:46.000Z"}
{"max_stars_count": 14668, "max_issues_count": 395, "max_forks_count": 5941, "avg_line_length": 27.0789473684, "max_line_length": 77, "alphanum_fraction": 0.6132167153}
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This tests whether we have permission to use individual functions, despite
// not having asked for any permissions in the manifest.

chrome.test.runTests([

  // Test the tabs API.
  function tabs() {
    try {
      chrome.tabs.create({url: "404_is_enough.html"}, function(tab1) {
        chrome.tabs.update(tab1.id, {url: "404_again.html"}, function(tab2) {
          chrome.tabs.onRemoved.addListener(function(tabId, removeInfo) {
            chrome.test.assertEq(tab1.id, tabId);
            chrome.test.succeed();
          });
          chrome.tabs.remove(tab1.id);
        });
      });
    } catch (e) {
      chrome.test.fail();
    }
  },

  // Negative test for the tabs API.
  function tabsNegative() {
    try {
      var tab = chrome.tabs.getSelected();
      chrome.test.fail();
    } catch (e) {
      chrome.test.succeed();
    }
  }

]);
