| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/sessions/session_types.h" | 10 #include "chrome/browser/sessions/session_types.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 EXPECT_EQ(kTime2, | 368 EXPECT_EQ(kTime2, |
| 369 SessionTypesTestHelper::GetTimestamp(session_tab.navigations[1])); | 369 SessionTypesTestHelper::GetTimestamp(session_tab.navigations[1])); |
| 370 EXPECT_EQ(kTime3, | 370 EXPECT_EQ(kTime3, |
| 371 SessionTypesTestHelper::GetTimestamp(session_tab.navigations[2])); | 371 SessionTypesTestHelper::GetTimestamp(session_tab.navigations[2])); |
| 372 EXPECT_TRUE(session_tab.session_storage_persistent_id.empty()); | 372 EXPECT_TRUE(session_tab.session_storage_persistent_id.empty()); |
| 373 } | 373 } |
| 374 | 374 |
| 375 // Create tab specifics with an empty favicon. Ensure it gets ignored and not | 375 // Create tab specifics with an empty favicon. Ensure it gets ignored and not |
| 376 // stored into the synced favicon lookups. | 376 // stored into the synced favicon lookups. |
| 377 TEST_F(SyncSessionModelAssociatorTest, LoadEmptyFavicon) { | 377 TEST_F(SyncSessionModelAssociatorTest, LoadEmptyFavicon) { |
| 378 std::string favicon = ""; | 378 std::string favicon; |
| 379 std::string favicon_url = "http://www.faviconurl.com/favicon.ico"; | 379 std::string favicon_url = "http://www.faviconurl.com/favicon.ico"; |
| 380 std::string page_url = "http://www.faviconurl.com/page.html"; | 380 std::string page_url = "http://www.faviconurl.com/page.html"; |
| 381 sync_pb::SessionTab tab; | 381 sync_pb::SessionTab tab; |
| 382 tab.set_favicon(favicon); | 382 tab.set_favicon(favicon); |
| 383 tab.set_favicon_source(favicon_url); | 383 tab.set_favicon_source(favicon_url); |
| 384 tab.set_favicon_type(sync_pb::SessionTab::TYPE_WEB_FAVICON); | 384 tab.set_favicon_type(sync_pb::SessionTab::TYPE_WEB_FAVICON); |
| 385 sync_pb::TabNavigation* navigation = tab.add_navigation(); | 385 sync_pb::TabNavigation* navigation = tab.add_navigation(); |
| 386 navigation->set_virtual_url(page_url); | 386 navigation->set_virtual_url(page_url); |
| 387 tab.set_current_navigation_index(0); | 387 tab.set_current_navigation_index(0); |
| 388 | 388 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 // The new page should be mapped to the old favicon data. | 464 // The new page should be mapped to the old favicon data. |
| 465 EXPECT_TRUE(FaviconEquals(GURL(page_url2), std::string())); | 465 EXPECT_TRUE(FaviconEquals(GURL(page_url2), std::string())); |
| 466 LoadTabFavicon(tab2); | 466 LoadTabFavicon(tab2); |
| 467 EXPECT_TRUE(FaviconEquals(GURL(page_url), favicon)); | 467 EXPECT_TRUE(FaviconEquals(GURL(page_url), favicon)); |
| 468 EXPECT_TRUE(FaviconEquals(GURL(page_url2), favicon)); | 468 EXPECT_TRUE(FaviconEquals(GURL(page_url2), favicon)); |
| 469 } | 469 } |
| 470 | 470 |
| 471 } // namespace | 471 } // namespace |
| 472 | 472 |
| 473 } // namespace browser_sync | 473 } // namespace browser_sync |
| OLD | NEW |