def test_fail_resourcemodules():
    """'resource modules' should fail validation."""
    c = ChromeManifest("resource modules foo", "chrome.manifest")
    err = ErrorBundle()
    err.save_resource("chrome.manifest", c)

    tc_chromemanifest.test_resourcemodules(err)
    assert err.failed()

    # Fail even if it's just a prefix.
    c = ChromeManifest("resource modulesfoo", "chrome.manifest")
    err = ErrorBundle()
    err.save_resource("chrome.manifest", c)

    tc_chromemanifest.test_resourcemodules(err)
    assert err.failed()
def test_fail_resourcemodules():
    """'resource modules' should fail validation."""
    c = chrome_manifest('resource modules foo')
    err = ErrorBundle()
    err.save_resource('chrome.manifest', c)

    tc_chromemanifest.test_resourcemodules(err)
    assert err.failed()

    # Fail even if it's just a prefix.
    c = chrome_manifest('resource modulesfoo')
    err = ErrorBundle()
    err.save_resource('chrome.manifest', c)

    tc_chromemanifest.test_resourcemodules(err)
    assert 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_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()