src/net/http/transport_security_persister_unittest.cc
// Tests that LoadEntries() clears existing non-static entries.
Tests that LoadEntries() clears existing non-static entries.
Tests that LoadEntries () clears existing non - static entries .
TEST_F(TransportSecurityPersisterTest, LoadEntriesClearsExistingState) {
  base::test::ScopedFeatureList feature_list;
  feature_list.InitAndEnableFeature(
      TransportSecurityState::kDynamicExpectCTFeature);
  std::string output;
  bool dirty;
  TransportSecurityState::STSState sts_state;
  TransportSecurityState::ExpectCTState expect_ct_state;
  const base::Time current_time(base::Time::Now());
  const base::Time expiry = current_time + base::TimeDelta::FromSeconds(1000);
  static const char kYahooDomain[] = "yahoo.com";
  EXPECT_FALSE(state_.GetDynamicSTSState(kYahooDomain, &sts_state, nullptr));
  state_.AddHSTS(kYahooDomain, expiry, false );
  state_.AddExpectCT(kYahooDomain, expiry, true , GURL());
  EXPECT_TRUE(state_.GetDynamicSTSState(kYahooDomain, &sts_state, nullptr));
  EXPECT_TRUE(state_.GetDynamicExpectCTState(kYahooDomain, &expect_ct_state));
  EXPECT_TRUE(persister_->LoadEntries("{}", &dirty));
  EXPECT_FALSE(dirty);
  EXPECT_FALSE(state_.GetDynamicSTSState(kYahooDomain, &sts_state, nullptr));
  EXPECT_FALSE(state_.GetDynamicExpectCTState(kYahooDomain, &expect_ct_state));
}
TEST_F ( TransportSecurityPersisterTest , LoadEntriesClearsExistingState ) { base :: test :: ScopedFeatureList feature_list ; feature_list . InitAndEnableFeature ( TransportSecurityState :: kDynamicExpectCTFeature ) ; std :: string output ; bool dirty ; TransportSecurityState :: STSState sts_state ; TransportSecurityState :: ExpectCTState expect_ct_state ; const base :: Time current_time ( base :: Time :: Now ( ) ) ; const base :: Time expiry = current_time + base :: TimeDelta :: FromSeconds ( 1000 ) ; static const char kYahooDomain [ ] = " " ; EXPECT_FALSE ( state_ . GetDynamicSTSState ( kYahooDomain , & sts_state , nullptr ) ) ; state_ . AddHSTS ( kYahooDomain , expiry , false ) ; state_ . AddExpectCT ( kYahooDomain , expiry , true , GURL ( ) ) ; EXPECT_TRUE ( state_ . GetDynamicSTSState ( kYahooDomain , & sts_state , nullptr ) ) ; EXPECT_TRUE ( state_ . GetDynamicExpectCTState ( kYahooDomain , & expect_ct_state ) ) ; EXPECT_TRUE ( persister_ -> LoadEntries ( " " , & dirty ) ) ; EXPECT_FALSE ( dirty ) ; EXPECT_FALSE ( state_ . GetDynamicSTSState ( kYahooDomain , & sts_state , nullptr ) ) ; EXPECT_FALSE ( state_ . GetDynamicExpectCTState ( kYahooDomain , & expect_ct_state ) ) ; }
Tests that LoadEntries() clears existing non-static entries.
Tests that LoadEntries () clears existing non - static entries .
/* include subdomains */ /* enforce */