function populateTestExceptions() {
  prefsGeolocation = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [
          test_util.createRawSiteException('https://bar-allow.com:443'),
          test_util.createRawSiteException('https://foo-allow.com:443'),
          test_util.createRawSiteException('https://bar-block.com:443', {
            setting: settings.ContentSetting.BLOCK,
          }),
          test_util.createRawSiteException('https://foo-block.com:443', {
            setting: settings.ContentSetting.BLOCK,
          })
        ]),
  ]);

  prefsControlled = test_util.createSiteSettingsPrefs(
      [], [test_util.createContentSettingTypeToValuePair(
              settings.ContentSettingsTypes.PLUGINS,
              [test_util.createRawSiteException('http://foo-block.com', {
                embeddingOrigin: '',
                setting: settings.ContentSetting.BLOCK,
                source: settings.SiteSettingSource.POLICY,
              })])]);

  prefsMixedSchemes = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [
          test_util.createRawSiteException('https://foo-allow.com', {
            source: settings.SiteSettingSource.POLICY,
          }),
          test_util.createRawSiteException('bar-allow.com'),
        ]),
  ]);

  prefsMixedProvider = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [
          test_util.createRawSiteException('https://[*.]foo.com', {
            setting: settings.ContentSetting.BLOCK,
            source: settings.SiteSettingSource.POLICY,
          }),
          test_util.createRawSiteException('https://bar.foo.com', {
            setting: settings.ContentSetting.BLOCK,
            source: settings.SiteSettingSource.POLICY,
          }),
          test_util.createRawSiteException('https://[*.]foo.com', {
            setting: settings.ContentSetting.BLOCK,
            source: settings.SiteSettingSource.POLICY,
          })
        ]),
  ]);

  prefsMixedEmbeddingOrigin = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.IMAGES,
        [
          test_util.createRawSiteException('https://foo.com', {
            embeddingOrigin: 'https://example.com',
          }),
          test_util.createRawSiteException('https://bar.com', {
            embeddingOrigin: '',
          })
        ]),
  ]);

  prefsVarious = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [
          test_util.createRawSiteException('https://foo.com', {
            embeddingOrigin: '',
          }),
          test_util.createRawSiteException('https://bar.com', {
            embeddingOrigin: '',
          })
        ]),
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.NOTIFICATIONS,
        [
          test_util.createRawSiteException('https://google.com', {
            embeddingOrigin: '',
          }),
          test_util.createRawSiteException('https://bar.com', {
            embeddingOrigin: '',
          }),
          test_util.createRawSiteException('https://foo.com', {
            embeddingOrigin: '',
          })
        ]),
  ]);

  prefsOneEnabled = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [test_util.createRawSiteException('https://foo-allow.com:443', {
          embeddingOrigin: '',
        })]),
  ]);

  prefsOneDisabled = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [test_util.createRawSiteException('https://foo-block.com:443', {
          embeddingOrigin: '',
          setting: settings.ContentSetting.BLOCK,
        })]),
  ]);

  prefsSessionOnly = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.COOKIES,
        [
          test_util.createRawSiteException('http://foo-block.com', {
            embeddingOrigin: '',
            setting: settings.ContentSetting.BLOCK,
          }),
          test_util.createRawSiteException('http://foo-allow.com', {
            embeddingOrigin: '',
          }),
          test_util.createRawSiteException('http://foo-session.com', {
            embeddingOrigin: '',
            setting: settings.ContentSetting.SESSION_ONLY,
          })
        ]),
  ]);

  prefsIncognito = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.COOKIES,
        [
          // foo.com is blocked for regular sessions.
          test_util.createRawSiteException('http://foo.com', {
            embeddingOrigin: '',
            setting: settings.ContentSetting.BLOCK,
          }),
          // bar.com is an allowed incognito item.
          test_util.createRawSiteException('http://bar.com', {
            embeddingOrigin: '',
            incognito: true,
          }),
          // foo.com is allowed in incognito (overridden).
          test_util.createRawSiteException('http://foo.com', {
            embeddingOrigin: '',
            incognito: true,
          })
        ]),
  ]);

  prefsChromeExtension = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.JAVASCRIPT,
        [test_util.createRawSiteException(
            'chrome-extension://cfhgfbfpcbnnbibfphagcjmgjfjmojfa/', {
              embeddingOrigin: '',
              setting: settings.ContentSetting.BLOCK,
            })]),
  ]);

  prefsGeolocationEmpty = test_util.createSiteSettingsPrefs([], []);
}
/**
 * Creates all the test |SiteSettingsPref|s that are needed for the tests in
 * this file. They are populated after test setup in order to access the
 * |settings| constants required.
 */
Creates all the test |SiteSettingsPref|s that are needed for the tests in
this file. They are populated after test setup in order to access the
|settings| constants required.
Creates all the test |SiteSettingsPref|s that are needed for the tests in this file . They are populated after test setup in order to access the |settings| constants required .
function populateTestExceptions() {
  prefsGeolocation = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [
          test_util.createRawSiteException('https://bar-allow.com:443'),
          test_util.createRawSiteException('https://foo-allow.com:443'),
          test_util.createRawSiteException('https://bar-block.com:443', {
            setting: settings.ContentSetting.BLOCK,
          }),
          test_util.createRawSiteException('https://foo-block.com:443', {
            setting: settings.ContentSetting.BLOCK,
          })
        ]),
  ]);
  prefsControlled = test_util.createSiteSettingsPrefs(
      [], [test_util.createContentSettingTypeToValuePair(
              settings.ContentSettingsTypes.PLUGINS,
              [test_util.createRawSiteException('http://foo-block.com', {
                embeddingOrigin: '',
                setting: settings.ContentSetting.BLOCK,
                source: settings.SiteSettingSource.POLICY,
              })])]);
  prefsMixedSchemes = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [
          test_util.createRawSiteException('https://foo-allow.com', {
            source: settings.SiteSettingSource.POLICY,
          }),
          test_util.createRawSiteException('bar-allow.com'),
        ]),
  ]);
  prefsMixedProvider = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [
          test_util.createRawSiteException('https://[*.]foo.com', {
            setting: settings.ContentSetting.BLOCK,
            source: settings.SiteSettingSource.POLICY,
          }),
          test_util.createRawSiteException('https://bar.foo.com', {
            setting: settings.ContentSetting.BLOCK,
            source: settings.SiteSettingSource.POLICY,
          }),
          test_util.createRawSiteException('https://[*.]foo.com', {
            setting: settings.ContentSetting.BLOCK,
            source: settings.SiteSettingSource.POLICY,
          })
        ]),
  ]);
  prefsMixedEmbeddingOrigin = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.IMAGES,
        [
          test_util.createRawSiteException('https://foo.com', {
            embeddingOrigin: 'https://example.com',
          }),
          test_util.createRawSiteException('https://bar.com', {
            embeddingOrigin: '',
          })
        ]),
  ]);
  prefsVarious = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [
          test_util.createRawSiteException('https://foo.com', {
            embeddingOrigin: '',
          }),
          test_util.createRawSiteException('https://bar.com', {
            embeddingOrigin: '',
          })
        ]),
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.NOTIFICATIONS,
        [
          test_util.createRawSiteException('https://google.com', {
            embeddingOrigin: '',
          }),
          test_util.createRawSiteException('https://bar.com', {
            embeddingOrigin: '',
          }),
          test_util.createRawSiteException('https://foo.com', {
            embeddingOrigin: '',
          })
        ]),
  ]);
  prefsOneEnabled = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [test_util.createRawSiteException('https://foo-allow.com:443', {
          embeddingOrigin: '',
        })]),
  ]);
  prefsOneDisabled = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.GEOLOCATION,
        [test_util.createRawSiteException('https://foo-block.com:443', {
          embeddingOrigin: '',
          setting: settings.ContentSetting.BLOCK,
        })]),
  ]);
  prefsSessionOnly = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.COOKIES,
        [
          test_util.createRawSiteException('http://foo-block.com', {
            embeddingOrigin: '',
            setting: settings.ContentSetting.BLOCK,
          }),
          test_util.createRawSiteException('http://foo-allow.com', {
            embeddingOrigin: '',
          }),
          test_util.createRawSiteException('http://foo-session.com', {
            embeddingOrigin: '',
            setting: settings.ContentSetting.SESSION_ONLY,
          })
        ]),
  ]);
  prefsIncognito = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.COOKIES,
        [
          test_util.createRawSiteException('http://foo.com', {
            embeddingOrigin: '',
            setting: settings.ContentSetting.BLOCK,
          }),
          test_util.createRawSiteException('http://bar.com', {
            embeddingOrigin: '',
            incognito: true,
          }),
          test_util.createRawSiteException('http://foo.com', {
            embeddingOrigin: '',
            incognito: true,
          })
        ]),
  ]);
  prefsChromeExtension = test_util.createSiteSettingsPrefs([], [
    test_util.createContentSettingTypeToValuePair(
        settings.ContentSettingsTypes.JAVASCRIPT,
        [test_util.createRawSiteException(
            'chrome-extension://cfhgfbfpcbnnbibfphagcjmgjfjmojfa/', {
              embeddingOrigin: '',
              setting: settings.ContentSetting.BLOCK,
            })]),
  ]);
  prefsGeolocationEmpty = test_util.createSiteSettingsPrefs([], []);
}
function populateTestExceptions ( ) { prefsGeolocation = test_util . createSiteSettingsPrefs ( [ ] , [ test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . GEOLOCATION , [ test_util . createRawSiteException ( 'https://bar-allow.com:443' ) , test_util . createRawSiteException ( 'https://foo-allow.com:443' ) , test_util . createRawSiteException ( 'https://bar-block.com:443' , { setting : settings . ContentSetting . BLOCK , } ) , test_util . createRawSiteException ( 'https://foo-block.com:443' , { setting : settings . ContentSetting . BLOCK , } ) ] ) , ] ) ; prefsControlled = test_util . createSiteSettingsPrefs ( [ ] , [ test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . PLUGINS , [ test_util . createRawSiteException ( 'http://foo-block.com' , { embeddingOrigin : '' , setting : settings . ContentSetting . BLOCK , source : settings . SiteSettingSource . POLICY , } ) ] ) ] ) ; prefsMixedSchemes = test_util . createSiteSettingsPrefs ( [ ] , [ test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . GEOLOCATION , [ test_util . createRawSiteException ( 'https://foo-allow.com' , { source : settings . SiteSettingSource . POLICY , } ) , test_util . createRawSiteException ( 'bar-allow.com' ) , ] ) , ] ) ; prefsMixedProvider = test_util . createSiteSettingsPrefs ( [ ] , [ test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . GEOLOCATION , [ test_util . createRawSiteException ( 'https://[*.]foo.com' , { setting : settings . ContentSetting . BLOCK , source : settings . SiteSettingSource . POLICY , } ) , test_util . createRawSiteException ( 'https://bar.foo.com' , { setting : settings . ContentSetting . BLOCK , source : settings . SiteSettingSource . POLICY , } ) , test_util . createRawSiteException ( 'https://[*.]foo.com' , { setting : settings . ContentSetting . BLOCK , source : settings . SiteSettingSource . POLICY , } ) ] ) , ] ) ; prefsMixedEmbeddingOrigin = test_util . createSiteSettingsPrefs ( [ ] , [ test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . IMAGES , [ test_util . createRawSiteException ( 'https://foo.com' , { embeddingOrigin : 'https://example.com' , } ) , test_util . createRawSiteException ( 'https://bar.com' , { embeddingOrigin : '' , } ) ] ) , ] ) ; prefsVarious = test_util . createSiteSettingsPrefs ( [ ] , [ test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . GEOLOCATION , [ test_util . createRawSiteException ( 'https://foo.com' , { embeddingOrigin : '' , } ) , test_util . createRawSiteException ( 'https://bar.com' , { embeddingOrigin : '' , } ) ] ) , test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . NOTIFICATIONS , [ test_util . createRawSiteException ( 'https://google.com' , { embeddingOrigin : '' , } ) , test_util . createRawSiteException ( 'https://bar.com' , { embeddingOrigin : '' , } ) , test_util . createRawSiteException ( 'https://foo.com' , { embeddingOrigin : '' , } ) ] ) , ] ) ; prefsOneEnabled = test_util . createSiteSettingsPrefs ( [ ] , [ test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . GEOLOCATION , [ test_util . createRawSiteException ( 'https://foo-allow.com:443' , { embeddingOrigin : '' , } ) ] ) , ] ) ; prefsOneDisabled = test_util . createSiteSettingsPrefs ( [ ] , [ test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . GEOLOCATION , [ test_util . createRawSiteException ( 'https://foo-block.com:443' , { embeddingOrigin : '' , setting : settings . ContentSetting . BLOCK , } ) ] ) , ] ) ; prefsSessionOnly = test_util . createSiteSettingsPrefs ( [ ] , [ test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . COOKIES , [ test_util . createRawSiteException ( 'http://foo-block.com' , { embeddingOrigin : '' , setting : settings . ContentSetting . BLOCK , } ) , test_util . createRawSiteException ( 'http://foo-allow.com' , { embeddingOrigin : '' , } ) , test_util . createRawSiteException ( 'http://foo-session.com' , { embeddingOrigin : '' , setting : settings . ContentSetting . SESSION_ONLY , } ) ] ) , ] ) ; prefsIncognito = test_util . createSiteSettingsPrefs ( [ ] , [ test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . COOKIES , [ test_util . createRawSiteException ( 'http://foo.com' , { embeddingOrigin : '' , setting : settings . ContentSetting . BLOCK , } ) , test_util . createRawSiteException ( 'http://bar.com' , { embeddingOrigin : '' , incognito : true , } ) , test_util . createRawSiteException ( 'http://foo.com' , { embeddingOrigin : '' , incognito : true , } ) ] ) , ] ) ; prefsChromeExtension = test_util . createSiteSettingsPrefs ( [ ] , [ test_util . createContentSettingTypeToValuePair ( settings . ContentSettingsTypes . JAVASCRIPT , [ test_util . createRawSiteException ( 'chrome-extension://cfhgfbfpcbnnbibfphagcjmgjfjmojfa/' , { embeddingOrigin : '' , setting : settings . ContentSetting . BLOCK , } ) ] ) , ] ) ; prefsGeolocationEmpty = test_util . createSiteSettingsPrefs ( [ ] , [ ] ) ; }
Creates all the test |SiteSettingsPref|s that are needed for the tests in
 this file.
Creates all the test |SiteSettingsPref|s that are needed for the tests in this file .
// foo.com is blocked for regular sessions. // bar.com is an allowed incognito item. // foo.com is allowed in incognito (overridden).