Beispiel #1
0
def validate(
    path,
    format="json",
    approved_applications=os.path.join(os.path.dirname(__file__), "app_versions.json"),
    determined=True,
    spidermonkey=False,
    listed=True,
    expectation=PACKAGE_ANY,
):
    """Perform validation in one easy step!
    
    format : The format to output the results in
    approved_applications : Path to the list of approved application versions
    determined : Whether the validator should continue after a tier fails
    spidermonkey : Path to the local spidermonkey installation (Default: False)
    listed : True if the add-on is destined for AMO, false if not
    expectation : The type of package that should be expected
    """

    # Load up the target applications
    apps = json.load(open(approved_applications))
    validator.testcases.targetapplication.APPROVED_APPLICATIONS = apps

    bundle = ErrorBundle(listed=listed, determined=determined)
    if spidermonkey != False:
        bundle.save_resource("SPIDERMONKEY", spidermonkey)

    validator.submain.prepare_package(bundle, path, expectation)

    # Write the results to the pipe
    formats = {"json": lambda b: b.render_json()}
    if format is not None:
        return formats[format](bundle)
    else:
        return bundle
def setup_err(package_json=None, err=None):
    if err is None:
        err = ErrorBundle()
    if package_json is not None:
        err.save_resource("has_package_json", True)
        err.save_resource("package_json", package_json)
    return err
def test_duplicate_files():
    """Test that duplicate files in a package are caught."""

    err = ErrorBundle()
    err.save_resource("has_install_rdf", True)
    packagelayout.test_layout_all(err, MockDupeXPI())
    assert err.failed()
def _test(script):
    err = ErrorBundle()
    err.supported_versions = {}
    err.save_resource("em:bootstrap", "true")
    scripting.test_js_file(err, "foo", script)

    return err
Beispiel #5
0
def _test(script):
    err = ErrorBundle()
    err.supported_versions = {}
    err.save_resource('em:bootstrap', 'true')
    scripting.test_js_file(err, 'foo', script)

    return err
def test_duplicate_files():
    """Test that duplicate files in a package are caught."""

    err = ErrorBundle()
    err.save_resource('has_install_rdf', True)
    packagelayout.test_layout_all(err, MockDupeXPI())
    assert err.failed()
def _do_test(xpi_package, allow_old_sdk=True, compat=False):

    err = ErrorBundle()
    if compat:
        err.save_resource('is_compat_test', True)
    jetpack.inspect_jetpack(err, xpi_package, allow_old_sdk=allow_old_sdk)
    return err
def test_jar_nonsubpackage():
    "Tests XPI files that are not subpackages."

    err = ErrorBundle()
    err.set_type(PACKAGE_MULTI)
    err.save_resource("is_multipackage", True)
    mock_package = MockXPI(
        {"foo.jar":
             "tests/resources/content/subpackage.jar",
         "chrome/bar.jar":
             "tests/resources/content/subpackage.jar"})

    content.testendpoint_validator = MockTestEndpoint(("test_inner_package",
                                                       "test_package"))

    result = content.test_packed_packages(
                                    err,
                                    mock_package)
    print result
    assert result == 2
    content.testendpoint_validator.assert_expectation(
                                    "test_package",
                                    2)
    content.testendpoint_validator.assert_expectation(
                                    "test_package",
                                    0,
                                    "subpackage")
Beispiel #9
0
def setup_err(package_json=None, err=None):
    if err is None:
        err = ErrorBundle()
    if package_json is not None:
        err.save_resource("has_package_json", True)
        err.save_resource("package_json", package_json)
    return err
def setup_err(manifest_json=None, err=None):
    if err is None:
        err = ErrorBundle()
    if manifest_json is not None:
        err.save_resource('has_manifest_json', True)
        err.save_resource('manifest_json', manifest_json)
    return err
def _test(script):
    err = ErrorBundle()
    err.supported_versions = {}
    err.save_resource('em:bootstrap', 'true')
    scripting.test_js_file(err, 'foo', script)

    return err
def test_overlay_object():
    """Test that overlay instructions have all its properties."""

    err = ErrorBundle()

    c = chrome_manifest("""
        content namespace /foo/bar
        overlay namespace /uri/goes/here
    """)

    err.save_resource('chrome.manifest', c)
    c.get_applicable_overlays(err)
    assert not err.failed()
    assert not err.notices

    err = ErrorBundle()

    c = chrome_manifest("""
        content namespace /foo/bar
        overlay /uri/goes/here
    """)
    err.save_resource('chrome.manifest', c)
    c.get_applicable_overlays(err)
    assert err.failed()
    assert not err.notices
Beispiel #13
0
def test_overlay_object():
    """Test that overlay instructions have all its properties."""

    err = ErrorBundle()

    c = chrome_manifest("""
        content namespace /foo/bar
        overlay namespace /uri/goes/here
    """)

    err.save_resource('chrome.manifest', c)
    c.get_applicable_overlays(err)
    assert not err.failed()
    assert not err.notices

    err = ErrorBundle()

    c = chrome_manifest("""
        content namespace /foo/bar
        overlay /uri/goes/here
    """)
    err.save_resource('chrome.manifest', c)
    c.get_applicable_overlays(err)
    assert err.failed()
    assert not err.notices
def test_marking_overlays():
    """
    Mark an overlay, then test that it marks the scripts within the overlay.
    """

    err = ErrorBundle()
    err.supported_versions = {}
    c = ChromeManifest("""
    content ns1 foo/
    overlay chrome://foo chrome://ns1/content/main.xul
    """, "chrome.manifest")
    err.save_resource("chrome.manifest", c)
    err.save_resource("chrome.manifest_nopush", c)

    xpi = MockXPI({"foo/main.xul": "tests/resources/content/script_list.xul"})

    content.test_packed_packages(err, xpi)
    assert not err.failed()

    marked_scripts = err.get_resource("marked_scripts")
    print marked_scripts
    assert marked_scripts

    eq_(marked_scripts, set(["chrome://ns1/foo.js",
                             "chrome://ns1/bar.js",
                             "chrome://asdf/foo.js"]))
Beispiel #15
0
def test_marking_overlays():
    """
    Mark an overlay, then test that it marks the scripts within the overlay.
    """

    err = ErrorBundle()
    err.supported_versions = {}
    c = chrome_manifest("""
    content ns1 foo/
    overlay chrome://foo chrome://ns1/content/main.xul
    """)
    err.save_resource('chrome.manifest', c)
    err.save_resource('chrome.manifest_nopush', c)

    xpi = MockXPI({'foo/main.xul': 'tests/resources/content/script_list.xul'})

    content.test_packed_packages(err, xpi)
    assert not err.failed()

    marked_scripts = err.get_resource('marked_scripts')

    eq_(
        marked_scripts,
        set([
            'chrome://ns1/foo.js', 'chrome://ns1/bar.js',
            'chrome://asdf/foo.js'
        ]))
Beispiel #16
0
def test_marking_overlays_root_package():
    """
    Tests that '/' resolves correctly as a chrome content package.
    """

    err = ErrorBundle()
    err.supported_versions = {}
    manifest = chrome_manifest("""
    content ns1 /
    overlay chrome://foo chrome://ns1/content/main.xul
    """)
    err.save_resource('chrome.manifest', manifest)
    err.save_resource('chrome.manifest_nopush', manifest)

    xpi = MockXPI({'main.xul': 'tests/resources/content/script_list.xul'})

    content.test_packed_packages(err, xpi)
    assert not err.failed()

    marked_scripts = err.get_resource('marked_scripts')

    eq_(
        marked_scripts,
        set([
            'chrome://ns1/foo.js', 'chrome://ns1/bar.js',
            'chrome://asdf/foo.js'
        ]))
Beispiel #17
0
def _do_test(path, test, failure=True,
             require_install=False, set_type=0):
    
    package_data = open(path, "rb")
    package = XPIManager(package_data, path)
    contents = package.get_file_data()
    err = ErrorBundle()
    
    # Populate in the dependencies.
    if set_type:
        err.set_type(set_type) # Conduit test requires type
    if require_install:
        err.save_resource("has_install_rdf", True)
        rdf_data = package.read("install.rdf")
        install_rdf = RDFParser(rdf_data)
        err.save_resource("install_rdf", install_rdf)
    
    test(err, contents, package)
    
    print err.print_summary(verbose=True)
    
    if failure:
        assert err.failed()
    else:
        assert not err.failed()
    
    return err
Beispiel #18
0
def _do_test_raw(script,
                 path='foo.js',
                 bootstrap=False,
                 ignore_pollution=True,
                 detected_type=None,
                 jetpack=False,
                 instant=True):
    """Perform a test on a JS file."""

    err = ErrorBundle(instant=instant)
    if jetpack:
        err.metadata['is_jetpack'] = True

    err.handler = OutputHandler(sys.stdout, True)
    err.supported_versions = {}
    if bootstrap:
        err.save_resource('em:bootstrap', True)
    if detected_type:
        err.detected_type = detected_type

    validator.testcases.content._process_file(err, MockXPI(), path, script,
                                              path.lower(),
                                              not ignore_pollution)
    if err.final_context is not None:
        print 'CONTEXT', repr(err.final_context.keys())

    return err
Beispiel #19
0
def _test(script):
    err = ErrorBundle()
    err.supported_versions = {}
    err.save_resource("em:bootstrap", "true")
    scripting.test_js_file(err, "foo", script)

    return err
Beispiel #20
0
def test_marking_overlays_subdir():
    """
    Mark an overlay in a subdirectory, then test that it marks the scripts
    within the overlay. Make sure it properly figures out relative URLs.
    """

    err = ErrorBundle()
    err.supported_versions = {}
    c = ChromeManifest("""
    content ns1 foo/
    overlay chrome://foo chrome://ns1/content/subdir/main.xul
    """, 'chrome.manifest')
    err.save_resource('chrome.manifest', c)
    err.save_resource('chrome.manifest_nopush', c)

    xpi = MockXPI({'foo/subdir/main.xul':
                       'tests/resources/content/script_list.xul'})

    content.test_packed_packages(err, xpi)
    assert not err.failed()

    marked_scripts = err.get_resource('marked_scripts')
    print marked_scripts
    assert marked_scripts

    eq_(marked_scripts, set(['chrome://ns1/subdir/foo.js', 'chrome://ns1/bar.js',
                             'chrome://asdf/foo.js']))
def _do_test(xpi_package, allow_old_sdk=True, compat=False):

    err = ErrorBundle()
    if compat:
        err.save_resource('is_compat_test', True)
    jetpack.inspect_jetpack(err, xpi_package, allow_old_sdk=allow_old_sdk)
    return err
def test_content_missing_information():
    """Test that incomplete information in a content instruction fails."""

    err = ErrorBundle()
    c = chrome_manifest('content foo')
    err.save_resource('chrome.manifest', c)
    tc_chromemanifest.test_content_instructions(err)
    assert err.failed()
def _do_test_raw_webextension(manifest, listed=True):
    err = ErrorBundle(listed=listed)
    manifest = ManifestJsonParser(err, manifest)
    err.save_resource('has_manifest_json', True)
    err.save_resource('manifest_json', manifest)

    targetapp.test_targetedapplications(err)
    return err
Beispiel #24
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 _do_test_raw_webextension(manifest, listed=True):
    err = ErrorBundle(listed=listed)
    manifest = ManifestJsonParser(err, manifest)
    err.save_resource('has_manifest_json', True)
    err.save_resource('manifest_json', manifest)

    targetapp.test_targetedapplications(err)
    return err
def test_content_missing_information():
    """Test that incomplete information in a content instruction fails."""

    err = ErrorBundle()
    c = ChromeManifest("content foo", "chrome.manifest")
    err.save_resource("chrome.manifest", c)
    tc_chromemanifest.test_content_instructions(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 _do_test_raw(rdf, listed=True, overrides=None):
    err = ErrorBundle(listed=listed)
    err.overrides = overrides
    rdf = RDFParser(err, rdf.strip())
    err.save_resource('has_install_rdf', True)
    err.save_resource('install_rdf', rdf)

    targetapp.test_targetedapplications(err)
    return err
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 = chrome_manifest('category foo bar')
    err = ErrorBundle()
    err.save_resource('chrome.manifest', c)

    tc_chromemanifest.test_categories(err)
    assert not err.failed()
def _do_test_raw(rdf, listed=True, overrides=None):
    err = ErrorBundle(listed=listed)
    err.overrides = overrides
    rdf = RDFParser(err, rdf.strip())
    err.save_resource('has_install_rdf', True)
    err.save_resource('install_rdf', rdf)

    targetapp.test_targetedapplications(err)
    return err
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 = ChromeManifest("category foo bar", "chrome.manifest")
    err = ErrorBundle()
    err.save_resource("chrome.manifest", c)

    tc_chromemanifest.test_categories(err)
    assert not err.failed()
def _do_test(unpack=False, contents=(), set_type=0, is_ff4=False):
    "Runs the tests. Handy as hell."
    
    err = ErrorBundle(None, True)
    if set_type:
        err.set_type(set_type)
    err.save_resource("em:unpack", unpack)
    err.save_resource("ff4", is_ff4)
    packagelayout.test_emunpack(err, contents, None)
    return err
def _do_test_raw(rdf, listed=True, overrides=None):
    err = ErrorBundle(listed=listed)
    err.overrides = overrides
    rdf = RDFParser(rdf.strip())
    err.save_resource("has_install_rdf", True)
    err.save_resource("install_rdf", rdf)

    targetapp.test_targetedapplications(err)
    print err.print_summary()
    return err
Beispiel #37
0
def test_valid_chrome_manifest():
    "Chrome manifests must only contain certain elements"

    err = ErrorBundle()
    err.save_resource("chrome.manifest", ChromeManifest("locale foo bar", ""))
    langpack.test_langpack_manifest(err, MockXPI())
    assert not err.failed()

    err.save_resource("chrome.manifest", ChromeManifest("foo bar asdf", ""))
    langpack.test_langpack_manifest(err, MockXPI())
    assert err.failed()
def test_valid_chrome_manifest():
    'Chrome manifests must only contain certain elements'

    err = ErrorBundle()
    err.save_resource('chrome.manifest', chrome_manifest('locale foo bar'))
    langpack.test_langpack_manifest(err, MockXPI())
    assert not err.failed()

    err.save_resource('chrome.manifest', chrome_manifest('foo bar asdf'))
    langpack.test_langpack_manifest(err, MockXPI())
    assert err.failed()
def test_valid_chrome_manifest():
    'Chrome manifests must only contain certain elements'

    err = ErrorBundle()
    err.save_resource('chrome.manifest', ChromeManifest('locale foo bar', ''))
    langpack.test_langpack_manifest(err, MockXPI())
    assert not err.failed()

    err.save_resource('chrome.manifest', ChromeManifest('foo bar asdf', ''))
    langpack.test_langpack_manifest(err, MockXPI())
    assert err.failed()
Beispiel #40
0
def test_valid_chrome_manifest():
    "Chrome manifests must only contain certain elements"

    err = ErrorBundle()
    err.save_resource("chrome.manifest", ChromeManifest("locale foo bar", ""))
    langpack.test_langpack_manifest(err, MockXPI())
    assert not err.failed()

    err.save_resource("chrome.manifest", ChromeManifest("foo bar asdf", ""))
    langpack.test_langpack_manifest(err, MockXPI())
    assert err.failed()
def test_unsigned_inner_xpi():
    """Test that inner XPIs need to be signed even if not multi-package."""
    xpi = MockXPI(subpackage=True)

    err = ErrorBundle()
    err.supported_versions = {}
    err.push_state('inner.xpi')
    err.save_resource('is_multipackage', False)

    content.test_signed_xpi(err, xpi)

    assert err.failed()
Beispiel #42
0
def test_unsigned_inner_xpi():
    """Test that inner XPIs need to be signed even if not multi-package."""
    xpi = MockXPI(subpackage=True)

    err = ErrorBundle()
    err.supported_versions = {}
    err.push_state('inner.xpi')
    err.save_resource('is_multipackage', False)

    content.test_signed_xpi(err, xpi)

    assert err.failed()
def test_has_rdf(install_rdf):
    "Tests that tests won't be run if there's no install.rdf"

    err = ErrorBundle()

    assert installrdf.test_install_rdf_params(err, None) is None

    err.detected_type = 0
    err.save_resource('install_rdf', RDFParser(err, '<rdf></rdf>'))
    err.save_resource('has_install_rdf', True)

    installrdf.test_install_rdf_params(err, None)
    assert install_rdf.called
Beispiel #44
0
def test_unsigned_inner_jar():
    """Test that inner packages don't need to be signed if not multipackage."""
    xpi = MockXPI(subpackage=True)
    xpi.filename = 'mock_jar.jar'

    err = ErrorBundle()
    err.supported_versions = {}
    err.push_state('inner.jar')
    err.save_resource('is_multipackage', False)

    content.test_signed_xpi(err, xpi)

    assert not err.failed()
def test_content_instructions():
    """Test that banned content namespaces are banned."""

    err = ErrorBundle()
    c = ChromeManifest("content foo bar", "chrome.manifest")
    err.save_resource("chrome.manifest", c)
    tc_chromemanifest.test_content_instructions(err)
    assert not err.failed()

    c = ChromeManifest("content godlikea bar", "chrome.manifest")
    err.save_resource("chrome.manifest", c)
    tc_chromemanifest.test_content_instructions(err)
    assert err.failed()
def test_content_instructions():
    """Test that banned content namespaces are banned."""

    err = ErrorBundle()
    c = chrome_manifest('content foo bar')
    err.save_resource('chrome.manifest', c)
    tc_chromemanifest.test_content_instructions(err)
    assert not err.failed()

    c = chrome_manifest('content godlikea bar')
    err.save_resource('chrome.manifest', c)
    tc_chromemanifest.test_content_instructions(err)
    assert err.failed()
def test_has_rdf(install_rdf):
    "Tests that tests won't be run if there's no install.rdf"

    err = ErrorBundle()

    assert installrdf.test_install_rdf_params(err, None) is None

    err.detected_type = 0
    err.save_resource("install_rdf", RDFParser(err, "<rdf></rdf>"))
    err.save_resource("has_install_rdf", True)

    installrdf.test_install_rdf_params(err, None)
    assert install_rdf.called
def test_unsigned_inner_jar():
    """Test that inner packages don't need to be signed if not multipackage."""
    xpi = MockXPI(subpackage=True)
    xpi.filename = 'mock_jar.jar'

    err = ErrorBundle()
    err.supported_versions = {}
    err.push_state('inner.jar')
    err.save_resource('is_multipackage', False)

    content.test_signed_xpi(err, xpi)

    assert not err.failed()
def _do_test(unpack=False, contents=None, set_type=0, is_ff4=False):
    'Runs the tests. Handy as hell.'

    if not contents:
        contents = []

    err = ErrorBundle(None, True)
    if set_type:
        err.detected_type = set_type
    err.save_resource('em:unpack', unpack)
    err.save_resource('ff4', is_ff4)
    packagelayout.test_emunpack(
        err, MockXPI(dict(zip(contents, [True for c in contents]))))
    return err
def _run_test_raw(data,
                  failure=True,
                  detected_type=0,
                  listed=True,
                  overrides=None,
                  compat=False):
    'Runs a test on an install.rdf snippet'

    data = data.strip()

    err = ErrorBundle()
    err.detected_type = detected_type
    err.save_resource('listed', listed)
    err.overrides = overrides

    if compat:
        err.save_resource('is_compat_test', True)

    err.save_resource('has_install_rdf', True)
    err.save_resource('install_rdf', RDFParser(err, data))
    installrdf.test_install_rdf_params(err)

    print err.print_summary(verbose=True)

    if failure:  # pragma: no cover
        assert err.failed() or err.notices
    else:
        assert not err.failed() and not err.notices

    return err
def _run_test_raw(data, failure=True, detected_type=0, listed=True,
                  overrides=None, compat=False):
    "Runs a test on an install.rdf snippet"

    data = data.strip()

    err = ErrorBundle()
    err.detected_type = detected_type
    err.save_resource("listed", listed)
    err.overrides = overrides

    if compat:
        err.save_resource("is_compat_test", True)

    err.save_resource("has_install_rdf", True)
    err.save_resource("install_rdf", RDFParser(err, data))
    installrdf.test_install_rdf_params(err)

    print err.print_summary(verbose=True)

    if failure:  # pragma: no cover
        assert err.failed() or err.notices
    else:
        assert not err.failed() and not err.notices

    return err
Beispiel #52
0
def _do_test(unpack=False, contents=None, set_type=0, is_ff4=False):
    "Runs the tests. Handy as hell."

    if not contents:
        contents = []

    err = ErrorBundle(None, True)
    if set_type:
        err.detected_type = set_type
    err.save_resource("em:unpack", unpack)
    err.save_resource("ff4", is_ff4)
    packagelayout.test_emunpack(
        err, MockXPI(dict(zip(contents, [True for c in contents]))))
    return err
Beispiel #53
0
def test_xpcnativewrappers():
    'Tests that xpcnativewrappers is not in the chrome.manifest'

    err = ErrorBundle()
    assert content.test_xpcnativewrappers(err, None) is None

    err.save_resource('chrome.manifest', chrome_manifest('foo bar'))
    content.test_xpcnativewrappers(err, None)
    assert not err.failed()

    err.save_resource('chrome.manifest',
                      chrome_manifest('xpcnativewrappers on'))
    content.test_xpcnativewrappers(err, None)
    assert err.failed()
def test_scripting_disabled():
    "Ensures that Spidermonkey is not run if it is set to be disabled"

    err = ErrorBundle()
    err.save_resource("SPIDERMONKEY", None)
    assert scripting.test_js_file(err, "abc def", "foo bar") is None

    err = ErrorBundle()
    si = scripting.SPIDERMONKEY_INSTALLATION
    scripting.SPIDERMONKEY_INSTALLATION = None

    assert scripting.test_js_file(err, "abc def", "foo bar") is None

    scripting.SPIDERMONKEY_INSTALLATION = si
Beispiel #55
0
def test_scripting_disabled():
    "Ensures that Spidermonkey is not run if it is set to be disabled"

    err = ErrorBundle()
    err.save_resource("SPIDERMONKEY", None)
    assert scripting.test_js_file(err, "abc def", "foo bar") is None

    err = ErrorBundle()
    si = scripting.SPIDERMONKEY_INSTALLATION
    scripting.SPIDERMONKEY_INSTALLATION = None

    assert scripting.test_js_file(err, "abc def", "foo bar") is None

    scripting.SPIDERMONKEY_INSTALLATION = si
Beispiel #56
0
def test_unsigned_multi_xpi():
    """Test that unsigned inner packages raise an error."""
    xpi = MockXPI(subpackage=True)

    err = ErrorBundle()
    err.supported_versions = {}
    err.push_state('sub.xpi')
    err.save_resource('is_multipackage', True)

    content.test_signed_xpi(err, xpi)

    assert err.failed()
    assert not err.warnings
    assert err.errors
    assert err.errors[0]['id'] == ('testcases_content', 'unsigned_sub_xpi')
def test_content_instructions_trailing_slash():
    """Test that trailing slashes are necessary for content instructions."""

    err = ErrorBundle()
    c = chrome_manifest('content namespace /uri/goes/here')
    err.save_resource('chrome.manifest', c)
    tc_chromemanifest.test_content_instructions(err)
    assert not err.failed()
    assert err.notices

    err = ErrorBundle()
    c = chrome_manifest('content namespace /uri/goes/here/ flag=true')
    err.save_resource('chrome.manifest', c)
    tc_chromemanifest.test_content_instructions(err)
    assert not err.failed()
    assert not err.notices