Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 28 matching lines...) Expand all
39 bitmap.eraseColor(color); 39 bitmap.eraseColor(color);
40 return bitmap; 40 return bitmap;
41 } 41 }
42 42
43 class FaviconDelegate : public ui::MenuModelDelegate { 43 class FaviconDelegate : public ui::MenuModelDelegate {
44 public: 44 public:
45 FaviconDelegate() : was_called_(false) {} 45 FaviconDelegate() : was_called_(false) {}
46 46
47 void OnIconChanged(int model_index) override { 47 void OnIconChanged(int model_index) override {
48 was_called_ = true; 48 was_called_ = true;
49 base::MessageLoop::current()->Quit(); 49 base::MessageLoop::current()->QuitWhenIdle();
50 } 50 }
51 51
52 bool was_called() const { return was_called_; } 52 bool was_called() const { return was_called_; }
53 53
54 private: 54 private:
55 bool was_called_; 55 bool was_called_;
56 56
57 DISALLOW_COPY_AND_ASSIGN(FaviconDelegate); 57 DISALLOW_COPY_AND_ASSIGN(FaviconDelegate);
58 }; 58 };
59 59
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 // Verify we did get the expected favicon. 557 // Verify we did get the expected favicon.
558 EXPECT_EQ(0, memcmp(new_icon_bitmap.getPixels(), 558 EXPECT_EQ(0, memcmp(new_icon_bitmap.getPixels(),
559 valid_icon_bitmap.getPixels(), 559 valid_icon_bitmap.getPixels(),
560 new_icon_bitmap.getSize())); 560 new_icon_bitmap.getSize()));
561 561
562 // Make sure the browser deconstructor doesn't have problems. 562 // Make sure the browser deconstructor doesn't have problems.
563 browser->tab_strip_model()->CloseAllTabs(); 563 browser->tab_strip_model()->CloseAllTabs();
564 // This is required to prevent the message loop from hanging. 564 // This is required to prevent the message loop from hanging.
565 profile()->DestroyHistoryService(); 565 profile()->DestroyHistoryService();
566 } 566 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698