示例#1
0
def test_js_categories_gecko1():
    """Test that JS categories raise problems for space-delimited values."""
    c = ChromeManifest('category JavaScript global foo bar', 'chrome.manifest')
    err = ErrorBundle()
    err.save_resource('chrome.manifest', c)

    tc_chromemanifest.test_categories(err)
    assert err.failed()
def test_js_categories_gecko1():
    """Test that JS categories raise problems for space-delimited values."""
    c = ChromeManifest("category JavaScript global foo bar", "chrome.manifest")
    err = ErrorBundle()
    err.save_resource("chrome.manifest", c)

    tc_chromemanifest.test_categories(err)
    assert err.failed()
def test_pass():
    """Test that standard category subjects pass."""

    c = ChromeManifest("category foo bar", "chrome.manifest")
    err = ErrorBundle()
    err.save_resource("chrome.manifest", c)

    tc_chromemanifest.test_categories(err)
    assert not err.failed()
def test_pass():
    """Test that standard category subjects pass."""

    c = chrome_manifest('category foo bar')
    err = ErrorBundle()
    err.save_resource('chrome.manifest', c)

    tc_chromemanifest.test_categories(err)
    assert not err.failed()
def test_pass():
    """Test that standard category subjects pass."""

    c = ChromeManifest("category foo bar", "chrome.manifest")
    err = ErrorBundle()
    err.save_resource("chrome.manifest", c)

    tc_chromemanifest.test_categories(err)
    assert not err.failed()
def test_js_categories_gecko2():
    """Test that JS categories raise problems for hyphenated values."""
    c = ChromeManifest("category JavaScript-DOM-class foo bar",
                       "chrome.manifest")
    err = ErrorBundle()
    err.save_resource("chrome.manifest", c)

    tc_chromemanifest.test_categories(err)
    assert err.failed()
def test_pass():
    """Test that standard category subjects pass."""

    c = chrome_manifest('category foo bar')
    err = ErrorBundle()
    err.save_resource('chrome.manifest', c)

    tc_chromemanifest.test_categories(err)
    assert not err.failed()
def test_js_categories_gecko2():
    """Test that JS categories raise problems for hyphenated values."""
    c = chrome_manifest('category JavaScript-DOM-class foo bar')
    err = ErrorBundle()
    err.save_resource('chrome.manifest', c)

    tc_chromemanifest.test_categories(err)
    assert err.failed()

    warning = {'id': ('testcases_chromemanifest', 'test_resourcemodules',
                      'resource_modules'),
               'message': 'Potentially dangerous category entry',
               'signing_severity': 'medium',
               'editors_only': True}
    msg = err.warnings[0]
    for key, value in warning.iteritems():
        assert msg[key] == value
def test_js_categories_gecko2():
    """Test that JS categories raise problems for hyphenated values."""
    c = ChromeManifest("category JavaScript-DOM-class foo bar",
                       "chrome.manifest")
    err = ErrorBundle()
    err.save_resource("chrome.manifest", c)

    tc_chromemanifest.test_categories(err)
    assert err.failed()

    warning = {"id": ("testcases_chromemanifest", "test_resourcemodules",
                      "resource_modules"),
               "message": "Potentially dangerous category entry",
               "signing_severity": "medium",
               "editors_only": True}
    msg = err.warnings[0]
    for key, value in warning.iteritems():
        eq_(msg[key], value)
def test_no_chromemanifest():
    """
    Chrome manifest tests should not be run if there is no chrome manifest.
    """
    err = ErrorBundle()
    assert tc_chromemanifest.test_categories(err) is None
    assert not err.failed()

    err = ErrorBundle()
    assert tc_chromemanifest.test_resourcemodules(err) is None
    assert not err.failed()
def test_no_chromemanifest():
    """
    Chrome manifest tests should not be run if there is no chrome manifest.
    """
    err = ErrorBundle()
    assert tc_chromemanifest.test_categories(err) is None
    assert not err.failed()

    err = ErrorBundle()
    assert tc_chromemanifest.test_resourcemodules(err) is None
    assert not err.failed()
def test_js_categories_gecko2():
    """Test that JS categories raise problems for hyphenated values."""
    c = chrome_manifest('category JavaScript-DOM-class foo bar')
    err = ErrorBundle()
    err.save_resource('chrome.manifest', c)

    tc_chromemanifest.test_categories(err)
    assert err.failed()

    warning = {
        'id': ('testcases_chromemanifest', 'test_resourcemodules',
               'resource_modules'),
        'message':
        'Potentially dangerous category entry',
        'signing_severity':
        'medium',
        'editors_only':
        True
    }
    msg = err.warnings[0]
    for key, value in warning.iteritems():
        assert msg[key] == value