Chromium Code Reviews| Index: components/sessions/content/content_serialized_navigation_builder_unittest.cc |
| diff --git a/components/sessions/content/content_serialized_navigation_builder_unittest.cc b/components/sessions/content/content_serialized_navigation_builder_unittest.cc |
| index 5f402982435e72c63e92c029be725b0a11911c3f..c48dc962dfb7e142a75f5434a6e984eae7f66aa9 100644 |
| --- a/components/sessions/content/content_serialized_navigation_builder_unittest.cc |
| +++ b/components/sessions/content/content_serialized_navigation_builder_unittest.cc |
| @@ -87,20 +87,32 @@ void SetExtendedInfoForTest(content::NavigationEntry* entry) { |
| base::ASCIIToUTF16(kExtendedInfoValue1)); |
| entry->SetExtraData(kExtendedInfoKey2, |
| base::ASCIIToUTF16(kExtendedInfoValue2)); |
| - ContentSerializedNavigationDriver::GetInstance()->RegisterExtendedInfoHandler( |
| - kExtendedInfoKey1, base::WrapUnique<ExtendedInfoHandler>( |
| - new TestExtendedInfoHandler(kExtendedInfoKey1))); |
| - ContentSerializedNavigationDriver::GetInstance()->RegisterExtendedInfoHandler( |
| - kExtendedInfoKey2, base::WrapUnique<ExtendedInfoHandler>( |
| - new TestExtendedInfoHandler(kExtendedInfoKey2))); |
| } |
| } // namespace |
| +class ContentSerializedNavigationBuilderTest : public testing::Test { |
| + public: |
| + ContentSerializedNavigationBuilderTest() {} |
| + ~ContentSerializedNavigationBuilderTest() override {} |
| + |
| + static void SetUpTestCase() { |
| + ContentSerializedNavigationDriver::GetInstance()-> |
|
sky
2016/10/06 17:01:47
While this works for your test, it means any other
jianli
2016/10/06 23:54:50
Done.
|
| + RegisterExtendedInfoHandler( |
| + kExtendedInfoKey1, |
| + base::WrapUnique<ExtendedInfoHandler>( |
| + new TestExtendedInfoHandler(kExtendedInfoKey1))); |
| + ContentSerializedNavigationDriver::GetInstance()-> |
| + RegisterExtendedInfoHandler( |
| + kExtendedInfoKey2, |
| + base::WrapUnique<ExtendedInfoHandler>( |
| + new TestExtendedInfoHandler(kExtendedInfoKey2))); |
| + } |
| +}; |
| // Create a SerializedNavigationEntry from a NavigationEntry. All its fields |
| // should match the NavigationEntry's. |
| -TEST(ContentSerializedNavigationBuilderTest, FromNavigationEntry) { |
| +TEST_F(ContentSerializedNavigationBuilderTest, FromNavigationEntry) { |
| const std::unique_ptr<content::NavigationEntry> navigation_entry( |
| MakeNavigationEntryForTest()); |
| SetExtendedInfoForTest(navigation_entry.get()); |
| @@ -146,7 +158,7 @@ TEST(ContentSerializedNavigationBuilderTest, FromNavigationEntry) { |
| // a SerializedNavigationEntry and back. The new one should match the old one |
| // except for fields that aren't preserved, which should be set to |
| // expected values. |
| -TEST(ContentSerializedNavigationBuilderTest, ToNavigationEntry) { |
| +TEST_F(ContentSerializedNavigationBuilderTest, ToNavigationEntry) { |
| const std::unique_ptr<content::NavigationEntry> old_navigation_entry( |
| MakeNavigationEntryForTest()); |
| SetExtendedInfoForTest(old_navigation_entry.get()); |
| @@ -197,7 +209,7 @@ TEST(ContentSerializedNavigationBuilderTest, ToNavigationEntry) { |
| EXPECT_EQ(kExtendedInfoValue2, base::UTF16ToASCII(extra_data)); |
| } |
| -TEST(ContentSerializedNavigationBuilderTest, SetPasswordState) { |
| +TEST_F(ContentSerializedNavigationBuilderTest, SetPasswordState) { |
| std::unique_ptr<content::NavigationEntry> entry( |
| content::NavigationEntry::Create()); |