OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 std::string error_; | 126 std::string error_; |
127 int route_id_; | 127 int route_id_; |
128 int callback_id_; | 128 int callback_id_; |
129 | 129 |
130 DISALLOW_COPY_AND_ASSIGN(TestDelegate); | 130 DISALLOW_COPY_AND_ASSIGN(TestDelegate); |
131 }; | 131 }; |
132 | 132 |
133 class TestUI : public AppNotifyChannelUI { | 133 class TestUI : public AppNotifyChannelUI { |
134 public: | 134 public: |
135 TestUI() : delegate_(NULL) {} | 135 TestUI() : delegate_(NULL) {} |
136 ~TestUI() {} | 136 virtual ~TestUI() {} |
137 | 137 |
138 // AppNotifyChannelUI. | 138 // AppNotifyChannelUI. |
139 virtual void PromptSyncSetup(Delegate* delegate) OVERRIDE { | 139 virtual void PromptSyncSetup(Delegate* delegate) OVERRIDE { |
140 CHECK(!delegate_); | 140 CHECK(!delegate_); |
141 delegate_ = delegate; | 141 delegate_ = delegate; |
142 | 142 |
143 // If we have a result, post a task to call back the delegate with | 143 // If we have a result, post a task to call back the delegate with |
144 // it. Otherwise ReportResult can be called manually at some later point. | 144 // it. Otherwise ReportResult can be called manually at some later point. |
145 if (setup_result_.get()) { | 145 if (setup_result_.get()) { |
146 MessageLoop::current()->PostTask( | 146 MessageLoop::current()->PostTask( |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 SetupLogin(true, true); | 311 SetupLogin(true, true); |
312 SetupFetchAccessToken(true); | 312 SetupFetchAccessToken(true); |
313 SetupRecordGrant(true); | 313 SetupRecordGrant(true); |
314 SetupGetChannelId(true); | 314 SetupGetChannelId(true); |
315 | 315 |
316 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance(); | 316 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance(); |
317 RunServerTest(setup, "dummy_do_not_use", ""); | 317 RunServerTest(setup, "dummy_do_not_use", ""); |
318 } | 318 } |
319 | 319 |
320 } // namespace extensions | 320 } // namespace extensions |
OLD | NEW |