| 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 "chrome/browser/ui/toolbar/back_forward_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 EXPECT_TRUE(favicon_delegate.was_called()); | 544 EXPECT_TRUE(favicon_delegate.was_called()); |
| 545 | 545 |
| 546 // Verify the bitmaps match. | 546 // Verify the bitmaps match. |
| 547 gfx::Image valid_icon; | 547 gfx::Image valid_icon; |
| 548 // This time we will get the new favicon returned. | 548 // This time we will get the new favicon returned. |
| 549 back_model.GetIconAt(0, &valid_icon); | 549 back_model.GetIconAt(0, &valid_icon); |
| 550 | 550 |
| 551 SkBitmap default_icon_bitmap = *default_icon.ToSkBitmap(); | 551 SkBitmap default_icon_bitmap = *default_icon.ToSkBitmap(); |
| 552 SkBitmap valid_icon_bitmap = *valid_icon.ToSkBitmap(); | 552 SkBitmap valid_icon_bitmap = *valid_icon.ToSkBitmap(); |
| 553 | 553 |
| 554 SkAutoLockPixels a(new_icon_bitmap); | |
| 555 SkAutoLockPixels b(valid_icon_bitmap); | |
| 556 SkAutoLockPixels c(default_icon_bitmap); | |
| 557 // Verify we did not get the default favicon. | 554 // Verify we did not get the default favicon. |
| 558 EXPECT_NE(0, memcmp(default_icon_bitmap.getPixels(), | 555 EXPECT_NE(0, memcmp(default_icon_bitmap.getPixels(), |
| 559 valid_icon_bitmap.getPixels(), | 556 valid_icon_bitmap.getPixels(), |
| 560 default_icon_bitmap.getSize())); | 557 default_icon_bitmap.getSize())); |
| 561 // Verify we did get the expected favicon. | 558 // Verify we did get the expected favicon. |
| 562 EXPECT_EQ(0, memcmp(new_icon_bitmap.getPixels(), | 559 EXPECT_EQ(0, memcmp(new_icon_bitmap.getPixels(), |
| 563 valid_icon_bitmap.getPixels(), | 560 valid_icon_bitmap.getPixels(), |
| 564 new_icon_bitmap.getSize())); | 561 new_icon_bitmap.getSize())); |
| 565 | 562 |
| 566 // Make sure the browser deconstructor doesn't have problems. | 563 // Make sure the browser deconstructor doesn't have problems. |
| 567 browser->tab_strip_model()->CloseAllTabs(); | 564 browser->tab_strip_model()->CloseAllTabs(); |
| 568 } | 565 } |
| OLD | NEW |