OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 } | 546 } |
547 | 547 |
548 content::RenderProcessHost* process() const { return process_host_; } | 548 content::RenderProcessHost* process() const { return process_host_; } |
549 | 549 |
550 private: | 550 private: |
551 ~TestSpellCheckMessageFilter() override {} | 551 ~TestSpellCheckMessageFilter() override {} |
552 | 552 |
553 void HandleMessage(int, int, const base::string16& text) { | 553 void HandleMessage(int, int, const base::string16& text) { |
554 content::BrowserThread::PostTask( | 554 content::BrowserThread::PostTask( |
555 content::BrowserThread::UI, FROM_HERE, | 555 content::BrowserThread::UI, FROM_HERE, |
556 base::Bind(&TestSpellCheckMessageFilter::HandleMessageOnUI, this, | 556 base::BindOnce(&TestSpellCheckMessageFilter::HandleMessageOnUI, this, |
557 text)); | 557 text)); |
558 } | 558 } |
559 | 559 |
560 void HandleMessageOnUI(const base::string16& text) { | 560 void HandleMessageOnUI(const base::string16& text) { |
561 last_text_ = text; | 561 last_text_ = text; |
562 if (!text_received_) { | 562 if (!text_received_) { |
563 text_received_ = true; | 563 text_received_ = true; |
564 message_loop_runner_->Quit(); | 564 message_loop_runner_->Quit(); |
565 } | 565 } |
566 } | 566 } |
567 | 567 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 scoped_refptr<TestSpellCheckMessageFilter> filter = | 623 scoped_refptr<TestSpellCheckMessageFilter> filter = |
624 browser_client.GetSpellCheckMessageFilterForProcess( | 624 browser_client.GetSpellCheckMessageFilterForProcess( |
625 subframe->GetProcess()); | 625 subframe->GetProcess()); |
626 filter->Wait(); | 626 filter->Wait(); |
627 | 627 |
628 EXPECT_EQ(base::ASCIIToUTF16("zz."), filter->last_text()); | 628 EXPECT_EQ(base::ASCIIToUTF16("zz."), filter->last_text()); |
629 | 629 |
630 content::SetBrowserClientForTesting(old_browser_client); | 630 content::SetBrowserClientForTesting(old_browser_client); |
631 } | 631 } |
632 #endif // BUILDFLAG(ENABLE_SPELLCHECK) | 632 #endif // BUILDFLAG(ENABLE_SPELLCHECK) |
OLD | NEW |