| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2013 Google Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 namespace { | 55 namespace { |
| 56 | 56 |
| 57 | 57 |
| 58 class TestingObserver : public LifecycleObserver<DummyContext> { | 58 class TestingObserver : public LifecycleObserver<DummyContext> { |
| 59 public: | 59 public: |
| 60 TestingObserver(DummyContext* context) | 60 TestingObserver(DummyContext* context) |
| 61 : LifecycleObserver<DummyContext>(context) | 61 : LifecycleObserver<DummyContext>(context) |
| 62 , m_contextDestroyedCalled(false) | 62 , m_contextDestroyedCalled(false) |
| 63 { } | 63 { } |
| 64 | 64 |
| 65 virtual void contextDestroyed() OVERRIDE | 65 virtual void contextDestroyed() override |
| 66 { | 66 { |
| 67 LifecycleObserver<DummyContext>::contextDestroyed(); | 67 LifecycleObserver<DummyContext>::contextDestroyed(); |
| 68 m_contextDestroyedCalled = true; | 68 m_contextDestroyedCalled = true; |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool m_contextDestroyedCalled; | 71 bool m_contextDestroyedCalled; |
| 72 | 72 |
| 73 void unobserve() { observeContext(0); } | 73 void unobserve() { observeContext(0); } |
| 74 }; | 74 }; |
| 75 | 75 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 92 OwnPtr<TestingObserver> observer = adoptPtr(new TestingObserver(context.get(
))); | 92 OwnPtr<TestingObserver> observer = adoptPtr(new TestingObserver(context.get(
))); |
| 93 | 93 |
| 94 observer->unobserve(); | 94 observer->unobserve(); |
| 95 context.clear(); | 95 context.clear(); |
| 96 EXPECT_EQ(observer->lifecycleContext(), static_cast<DummyContext*>(0)); | 96 EXPECT_EQ(observer->lifecycleContext(), static_cast<DummyContext*>(0)); |
| 97 EXPECT_FALSE(observer->m_contextDestroyedCalled); | 97 EXPECT_FALSE(observer->m_contextDestroyedCalled); |
| 98 } | 98 } |
| 99 | 99 |
| 100 | 100 |
| 101 } | 101 } |
| OLD | NEW |