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

Unified Diff: chrome/browser/extensions/api/dial/dial_apitest.cc

Issue 2583853004: [chrome.dial] Adds chrome.dial.fetchDeviceDecription API. (Closed)
Patch Set: Fix initialization Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/dial/dial_apitest.cc
diff --git a/chrome/browser/extensions/api/dial/dial_apitest.cc b/chrome/browser/extensions/api/dial/dial_apitest.cc
index 73ef7ab600db024d07a6f3343f0acb607da39aa4..ad4f7255028f4b42519fc0f1c597b0bebe7e060e 100644
--- a/chrome/browser/extensions/api/dial/dial_apitest.cc
+++ b/chrome/browser/extensions/api/dial/dial_apitest.cc
@@ -16,6 +16,7 @@
#include "url/gurl.h"
using extensions::DialDeviceData;
+using extensions::DialDeviceDescription;
using extensions::Extension;
namespace api = extensions::api;
@@ -115,3 +116,22 @@ IN_PROC_BROWSER_TEST_F(DialAPITest, NonWhitelistedExtension) {
IN_PROC_BROWSER_TEST_F(DialAPITest, OnError) {
ASSERT_TRUE(RunExtensionSubtest("dial/experimental", "on_error.html"));
}
+
+IN_PROC_BROWSER_TEST_F(DialAPITest, FetchDeviceDescription) {
+ scoped_refptr<extensions::DialAPI> api =
+ extensions::DialAPIFactory::GetInstance()->GetForBrowserContext(
+ profile());
+ ASSERT_TRUE(api.get());
+
+ DialDeviceData test_device("testDeviceId",
+ GURL("http://127.0.0.1/description.xml"),
+ base::Time::Now());
+ test_device.set_label("testDevice");
+
+ DialDeviceDescription test_description("<xml>testDescription</xml>",
+ GURL("http://127.0.0.1/apps"));
+ api->SetDeviceForTest(test_device, test_description);
+
+ ASSERT_TRUE(RunExtensionSubtest("dial/experimental",
+ "fetch_device_description.html"));
+}

Powered by Google App Engine
This is Rietveld 408576698