Пример #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
Пример #2
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
Пример #3
0
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()
Пример #4
0
def _test(script):
    err = ErrorBundle()
    err.supported_versions = {}
    err.save_resource("em:bootstrap", "true")
    scripting.test_js_file(err, "foo", script)

    return err
Пример #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
Пример #6
0
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()
Пример #7
0
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
Пример #8
0
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")
Пример #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
Пример #10
0
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
Пример #12
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
Пример #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"]))
Пример #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'
        ]))
Пример #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'
        ]))
Пример #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
Пример #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
Пример #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
Пример #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']))
Пример #21
0
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
Пример #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
Пример #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()
Пример #38
0
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()
Пример #39
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()
Пример #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()
Пример #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()
Пример #43
0
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
Пример #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()
Пример #47
0
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
Пример #50
0
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
Пример #51
0
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
Пример #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
Пример #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
Пример #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
Пример #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