| 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 "content/browser/compositor/image_transport_factory.h" | 5 #include "content/browser/compositor/image_transport_factory.h" |
| 6 | 6 |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "cc/output/context_provider.h" | 8 #include "cc/output/context_provider.h" |
| 9 #include "content/browser/compositor/owned_mailbox.h" | 9 #include "content/browser/compositor/owned_mailbox.h" |
| 10 #include "content/public/browser/gpu_data_manager.h" | 10 #include "content/public/browser/gpu_data_manager.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 EXPECT_TRUE(mailbox->mailbox().IsZero()); | 66 EXPECT_TRUE(mailbox->mailbox().IsZero()); |
| 67 | 67 |
| 68 factory->RemoveObserver(&observer); | 68 factory->RemoveObserver(&observer); |
| 69 } | 69 } |
| 70 | 70 |
| 71 class ImageTransportFactoryTearDownBrowserTest : public ContentBrowserTest { | 71 class ImageTransportFactoryTearDownBrowserTest : public ContentBrowserTest { |
| 72 public: | 72 public: |
| 73 ImageTransportFactoryTearDownBrowserTest() {} | 73 ImageTransportFactoryTearDownBrowserTest() {} |
| 74 | 74 |
| 75 virtual void TearDown() { | 75 virtual void TearDown() { |
| 76 if (mailbox_) | 76 if (mailbox_.get()) |
| 77 EXPECT_TRUE(mailbox_->mailbox().IsZero()); | 77 EXPECT_TRUE(mailbox_->mailbox().IsZero()); |
| 78 ContentBrowserTest::TearDown(); | 78 ContentBrowserTest::TearDown(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 protected: | 81 protected: |
| 82 scoped_refptr<OwnedMailbox> mailbox_; | 82 scoped_refptr<OwnedMailbox> mailbox_; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 // This crashes on Mac. ImageTransportFactory is NULL unless | 85 // This crashes on Mac. ImageTransportFactory is NULL unless |
| 86 // --enable-delegated-renderer is passed, and after that, we'd need to spawn a | 86 // --enable-delegated-renderer is passed, and after that, we'd need to spawn a |
| (...skipping 14 matching lines...) Expand all Loading... |
| 101 return; | 101 return; |
| 102 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 102 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
| 103 GLHelper* helper = factory->GetGLHelper(); | 103 GLHelper* helper = factory->GetGLHelper(); |
| 104 ASSERT_TRUE(helper); | 104 ASSERT_TRUE(helper); |
| 105 mailbox_ = new OwnedMailbox(helper); | 105 mailbox_ = new OwnedMailbox(helper); |
| 106 EXPECT_FALSE(mailbox_->mailbox().IsZero()); | 106 EXPECT_FALSE(mailbox_->mailbox().IsZero()); |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // anonymous namespace | 109 } // anonymous namespace |
| 110 } // namespace content | 110 } // namespace content |
| OLD | NEW |