OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/favicon/favicon_service.h" | 9 #include "chrome/browser/favicon/favicon_service.h" |
10 #include "chrome/browser/intents/web_intents_registry.h" | 10 #include "chrome/browser/intents/web_intents_registry.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 virtual void SetServiceIcon(size_t index, const SkBitmap& icon) {} | 54 virtual void SetServiceIcon(size_t index, const SkBitmap& icon) {} |
55 | 55 |
56 virtual void SetDefaultServiceIcon(size_t index) { | 56 virtual void SetDefaultServiceIcon(size_t index) { |
57 num_default_icons_++; | 57 num_default_icons_++; |
58 } | 58 } |
59 | 59 |
60 virtual void WaitFor(int target_num_urls, int target_num_default_icons) { | 60 virtual void WaitFor(int target_num_urls, int target_num_default_icons) { |
61 while (num_urls_ != target_num_urls || | 61 while (num_urls_ != target_num_urls || |
62 num_default_icons_ != target_num_default_icons) { | 62 num_default_icons_ != target_num_default_icons) { |
63 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 63 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
64 ui_test_utils::RunAllPendingInMessageLoop(); | 64 ui_test_utils::RunAllPendingInMessageLoop(); |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 virtual void Close() {} | 68 virtual void Close() {} |
69 | 69 |
70 TabContents* SetInlineDisposition(const GURL& url) { return NULL; } | 70 TabContents* SetInlineDisposition(const GURL& url) { return NULL; } |
71 | 71 |
72 int num_urls_; | 72 int num_urls_; |
73 int num_default_icons_; | 73 int num_default_icons_; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 OnServiceChosen(controller, 1); | 185 OnServiceChosen(controller, 1); |
186 ASSERT_EQ(2, browser()->tab_count()); | 186 ASSERT_EQ(2, browser()->tab_count()); |
187 EXPECT_EQ(GURL(kServiceURL2), | 187 EXPECT_EQ(GURL(kServiceURL2), |
188 browser()->GetSelectedTabContents()->GetURL()); | 188 browser()->GetSelectedTabContents()->GetURL()); |
189 | 189 |
190 EXPECT_TRUE(host->dispatched_); | 190 EXPECT_TRUE(host->dispatched_); |
191 | 191 |
192 OnSendReturnMessage(controller); | 192 OnSendReturnMessage(controller); |
193 ASSERT_EQ(1, browser()->tab_count()); | 193 ASSERT_EQ(1, browser()->tab_count()); |
194 } | 194 } |
OLD | NEW |