OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/spellchecker/spellcheck_message_filter_mac.h" | 5 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/common/spellcheck_messages.h" | 8 #include "chrome/common/spellcheck_messages.h" |
9 #include "chrome/common/spellcheck_result.h" | 9 #include "chrome/common/spellcheck_result.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 TEST(SpellCheckMessageFilterMacTest, TestOverrideThread) { | 46 TEST(SpellCheckMessageFilterMacTest, TestOverrideThread) { |
47 static const uint32 kSpellcheckMessages[] = { | 47 static const uint32 kSpellcheckMessages[] = { |
48 SpellCheckHostMsg_RequestTextCheck::ID, | 48 SpellCheckHostMsg_RequestTextCheck::ID, |
49 }; | 49 }; |
50 scoped_refptr<SpellCheckMessageFilterMac> filter( | 50 scoped_refptr<SpellCheckMessageFilterMac> filter( |
51 new SpellCheckMessageFilterMac(0)); | 51 new SpellCheckMessageFilterMac(0)); |
52 content::BrowserThread::ID thread; | 52 content::BrowserThread::ID thread; |
53 IPC::Message message; | 53 IPC::Message message; |
54 for (size_t i = 0; i < arraysize(kSpellcheckMessages); ++i) { | 54 for (size_t i = 0; i < arraysize(kSpellcheckMessages); ++i) { |
55 message.SetHeaderValues(0, kSpellcheckMessages[i], 0 /* flags */); | 55 message.SetHeaderValues( |
| 56 0, kSpellcheckMessages[i], IPC::Message::PRIORITY_NORMAL); |
56 thread = content::BrowserThread::IO; | 57 thread = content::BrowserThread::IO; |
57 filter->OverrideThreadForMessage(message, &thread); | 58 filter->OverrideThreadForMessage(message, &thread); |
58 EXPECT_EQ(content::BrowserThread::UI, thread); | 59 EXPECT_EQ(content::BrowserThread::UI, thread); |
59 } | 60 } |
60 } | 61 } |
61 | 62 |
62 } // namespace | 63 } // namespace |
OLD | NEW |