Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Side by Side Diff: chrome/browser/extensions/api/dial/dial_apitest.cc

Issue 177003015: Pull AsyncApiFunction out of src/chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase for storage_api Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/extensions/api/dial/dial_api.h" 6 #include "chrome/browser/extensions/api/dial/dial_api.h"
7 #include "chrome/browser/extensions/api/dial/dial_api_factory.h" 7 #include "chrome/browser/extensions/api/dial/dial_api_factory.h"
8 #include "chrome/browser/extensions/api/dial/dial_registry.h" 8 #include "chrome/browser/extensions/api/dial/dial_registry.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 28 matching lines...) Expand all
39 #else 39 #else
40 #define MAYBE_DeviceListEvents DeviceListEvents 40 #define MAYBE_DeviceListEvents DeviceListEvents
41 #endif 41 #endif
42 // Test receiving DIAL API events. 42 // Test receiving DIAL API events.
43 IN_PROC_BROWSER_TEST_F(DialAPITest, MAYBE_DeviceListEvents) { 43 IN_PROC_BROWSER_TEST_F(DialAPITest, MAYBE_DeviceListEvents) {
44 // Setup the test. 44 // Setup the test.
45 ASSERT_TRUE(RunExtensionSubtest("dial/experimental", "device_list.html")); 45 ASSERT_TRUE(RunExtensionSubtest("dial/experimental", "device_list.html"));
46 46
47 // Send three device list updates. 47 // Send three device list updates.
48 scoped_refptr<extensions::DialAPI> api = 48 scoped_refptr<extensions::DialAPI> api =
49 extensions::DialAPIFactory::GetInstance()->GetForProfile(profile()); 49 extensions::DialAPIFactory::GetInstance()->GetForBrowserContext(
50 profile());
50 ASSERT_TRUE(api.get()); 51 ASSERT_TRUE(api.get());
51 extensions::DialRegistry::DeviceList devices; 52 extensions::DialRegistry::DeviceList devices;
52 53
53 54
54 ResultCatcher catcher; 55 ResultCatcher catcher;
55 56
56 DialDeviceData device1; 57 DialDeviceData device1;
57 device1.set_device_id("1"); 58 device1.set_device_id("1");
58 device1.set_label("1"); 59 device1.set_label("1");
59 device1.set_device_description_url(GURL("http://127.0.0.1/dd.xml")); 60 device1.set_device_description_url(GURL("http://127.0.0.1/dd.xml"));
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 101
101 EXPECT_TRUE(listener.WaitUntilSatisfied()); 102 EXPECT_TRUE(listener.WaitUntilSatisfied());
102 103
103 listener.Reply("go"); 104 listener.Reply("go");
104 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 105 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
105 } 106 }
106 107
107 IN_PROC_BROWSER_TEST_F(DialAPITest, OnError) { 108 IN_PROC_BROWSER_TEST_F(DialAPITest, OnError) {
108 ASSERT_TRUE(RunExtensionSubtest("dial/experimental", "on_error.html")); 109 ASSERT_TRUE(RunExtensionSubtest("dial/experimental", "on_error.html"));
109 } 110 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/dial/dial_api_factory.cc ('k') | chrome/browser/extensions/api/gcm/gcm_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698