| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "blimp/engine/browser/font_data_fetcher.h" | 6 #include "blimp/engine/browser/font_data_fetcher.h" |
| 7 #include "blimp/engine/mojo/font_fetcher_mojo_impl.h" | 7 #include "blimp/engine/mojo/font_fetcher_mojo_impl.h" |
| 8 #include "mojo/public/cpp/system/buffer.h" | 8 #include "mojo/public/cpp/system/buffer.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 : font_fetcher_mojo_impl_(new FakeFontDataFetcher()) {} | 55 : font_fetcher_mojo_impl_(new FakeFontDataFetcher()) {} |
| 56 ~FontFetcherMojoImplUnittest() override {} | 56 ~FontFetcherMojoImplUnittest() override {} |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 base::MessageLoop message_loop_; | 59 base::MessageLoop message_loop_; |
| 60 FontFetcherMojoImpl font_fetcher_mojo_impl_; | 60 FontFetcherMojoImpl font_fetcher_mojo_impl_; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 TEST_F(FontFetcherMojoImplUnittest, VerifyWriteToDataPipe) { | 63 TEST_F(FontFetcherMojoImplUnittest, VerifyWriteToDataPipe) { |
| 64 mojom::FontFetcherPtr mojo_ptr; | 64 mojom::FontFetcherPtr mojo_ptr; |
| 65 font_fetcher_mojo_impl_.BindRequest(GetProxy(&mojo_ptr)); | 65 font_fetcher_mojo_impl_.BindRequest(MakeRequest(&mojo_ptr)); |
| 66 | 66 |
| 67 // Expect that dummy font data is written correctly to a Mojo DataPipe. | 67 // Expect that dummy font data is written correctly to a Mojo DataPipe. |
| 68 mojo_ptr->GetFontStream(kFakeHash, base::Bind(&VerifyDataWriteCorrectly)); | 68 mojo_ptr->GetFontStream(kFakeHash, base::Bind(&VerifyDataWriteCorrectly)); |
| 69 | 69 |
| 70 // Expect empty handle if the font stream is empty. | 70 // Expect empty handle if the font stream is empty. |
| 71 mojo_ptr->GetFontStream("", base::Bind(&VerifyEmptyDataWrite)); | 71 mojo_ptr->GetFontStream("", base::Bind(&VerifyEmptyDataWrite)); |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace | 74 } // namespace |
| 75 } // namespace engine | 75 } // namespace engine |
| 76 } // namespace blimp | 76 } // namespace blimp |
| OLD | NEW |