chrome/browser/extensions/web_view_browsertest.cc
// This is the post-reset portion of the StoragePersistence test.  See
// PRE_StoragePersistence for main comment.
This is the post-reset portion of the StoragePersistence test.  See
PRE_StoragePersistence for main comment.
This is the post - reset portion of the StoragePersistence test . See PRE_StoragePersistence for main comment .
IN_PROC_BROWSER_TEST_F(WebViewTest, StoragePersistence) {
  ASSERT_TRUE(StartTestServer());
  GURL blank_url("about:blank");
  content::WebContents* cookie_contents1;
  content::WebContents* cookie_contents2;
  content::WebContents* named_partition_contents1;
  content::WebContents* named_partition_contents2;
  content::WebContents* persistent_partition_contents1;
  content::WebContents* persistent_partition_contents2;
  content::WebContents* persistent_partition_contents3;
  NavigateAndOpenAppForIsolation(blank_url, &cookie_contents1,
                                 &cookie_contents2, &named_partition_contents1,
                                 &named_partition_contents2,
                                 &persistent_partition_contents1,
                                 &persistent_partition_contents2,
                                 &persistent_partition_contents3);
  int cookie_size;
  std::string cookie_value;
  automation_util::GetCookies(GURL("http://localhost"),
                              cookie_contents1,
                              &cookie_size, &cookie_value);
  EXPECT_EQ("", cookie_value);
  automation_util::GetCookies(GURL("http://localhost"),
                              cookie_contents2,
                              &cookie_size, &cookie_value);
  EXPECT_EQ("", cookie_value);
  automation_util::GetCookies(GURL("http://localhost"),
                              named_partition_contents1,
                              &cookie_size, &cookie_value);
  EXPECT_EQ("", cookie_value);
  automation_util::GetCookies(GURL("http://localhost"),
                              named_partition_contents2,
                              &cookie_size, &cookie_value);
  EXPECT_EQ("", cookie_value);
  automation_util::GetCookies(GURL("http://localhost"),
                              persistent_partition_contents1,
                              &cookie_size, &cookie_value);
  EXPECT_EQ("persist1=true", cookie_value);
  automation_util::GetCookies(GURL("http://localhost"),
                              persistent_partition_contents2,
                              &cookie_size, &cookie_value);
  EXPECT_EQ("persist1=true", cookie_value);
  automation_util::GetCookies(GURL("http://localhost"),
                              persistent_partition_contents3,
                              &cookie_size, &cookie_value);
  EXPECT_EQ("persist2=true", cookie_value);
}
IN_PROC_BROWSER_TEST_F ( WebViewTest , StoragePersistence ) { ASSERT_TRUE ( StartTestServer ( ) ) ; GURL blank_url ( " " ) ; content :: WebContents * cookie_contents1 ; content :: WebContents * cookie_contents2 ; content :: WebContents * named_partition_contents1 ; content :: WebContents * named_partition_contents2 ; content :: WebContents * persistent_partition_contents1 ; content :: WebContents * persistent_partition_contents2 ; content :: WebContents * persistent_partition_contents3 ; NavigateAndOpenAppForIsolation ( blank_url , & cookie_contents1 , & cookie_contents2 , & named_partition_contents1 , & named_partition_contents2 , & persistent_partition_contents1 , & persistent_partition_contents2 , & persistent_partition_contents3 ) ; int cookie_size ; std :: string cookie_value ; automation_util :: GetCookies ( GURL ( " " ) , cookie_contents1 , & cookie_size , & cookie_value ) ; EXPECT_EQ ( " " , cookie_value ) ; automation_util :: GetCookies ( GURL ( " " ) , cookie_contents2 , & cookie_size , & cookie_value ) ; EXPECT_EQ ( " " , cookie_value ) ; automation_util :: GetCookies ( GURL ( " " ) , named_partition_contents1 , & cookie_size , & cookie_value ) ; EXPECT_EQ ( " " , cookie_value ) ; automation_util :: GetCookies ( GURL ( " " ) , named_partition_contents2 , & cookie_size , & cookie_value ) ; EXPECT_EQ ( " " , cookie_value ) ; automation_util :: GetCookies ( GURL ( " " ) , persistent_partition_contents1 , & cookie_size , & cookie_value ) ; EXPECT_EQ ( " " , cookie_value ) ; automation_util :: GetCookies ( GURL ( " " ) , persistent_partition_contents2 , & cookie_size , & cookie_value ) ; EXPECT_EQ ( " " , cookie_value ) ; automation_util :: GetCookies ( GURL ( " " ) , persistent_partition_contents3 , & cookie_size , & cookie_value ) ; EXPECT_EQ ( " " , cookie_value ) ; }
This is the post-reset portion of the StoragePersistence test.
This is the post - reset portion of the StoragePersistence test .
// We don't care where the main browser is on this test. // The first two partitions will be used to set cookies and ensure they are // shared. The named partition is used to ensure that cookies are isolated // between partitions within the same app. // Check that all in-memory partitions lost their state. // Check that all persistent partitions kept their state.