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

Side by Side Diff: chrome/browser/extensions/api/mdns/mdns_apitest.cc

Issue 668983003: Enable chrome.mdns for Chrome Apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Squash all changes into a single git commit Created 5 years, 8 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
« no previous file with comments | « chrome/browser/extensions/api/mdns/mdns_api_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/mdns/mdns_api.h" 6 #include "chrome/browser/extensions/api/mdns/mdns_api.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/common/extensions/api/mdns.h" 9 #include "chrome/common/extensions/api/mdns.h"
10 #include "extensions/common/switches.h" 10 #include "extensions/common/switches.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 void SetUpCommandLine(base::CommandLine* command_line) override { 45 void SetUpCommandLine(base::CommandLine* command_line) override {
46 ExtensionApiTest::SetUpCommandLine(command_line); 46 ExtensionApiTest::SetUpCommandLine(command_line);
47 command_line->AppendSwitchASCII( 47 command_line->AppendSwitchASCII(
48 extensions::switches::kWhitelistedExtensionID, 48 extensions::switches::kWhitelistedExtensionID,
49 "ddchlicdkolnonkihahngkmmmjnjlkkf"); 49 "ddchlicdkolnonkihahngkmmmjnjlkkf");
50 } 50 }
51 51
52 void SetUpTestDnsSdRegistry() { 52 void SetUpTestDnsSdRegistry() {
53 extensions::MDnsAPI* api = extensions::MDnsAPI::Get(profile()); 53 extensions::MDnsAPI* api = extensions::MDnsAPI::Get(profile());
54 dns_sd_registry_ = new MockDnsSdRegistry(api); 54 dns_sd_registry_ = new MockDnsSdRegistry(api);
55 EXPECT_CALL(*dns_sd_registry_, AddObserver(api))
56 .Times(1);
55 // Transfers ownership of the registry instance. 57 // Transfers ownership of the registry instance.
56 api->SetDnsSdRegistryForTesting( 58 api->SetDnsSdRegistryForTesting(
57 make_scoped_ptr<DnsSdRegistry>(dns_sd_registry_).Pass()); 59 make_scoped_ptr<DnsSdRegistry>(dns_sd_registry_).Pass());
58 } 60 }
59 61
60 protected: 62 protected:
61 MockDnsSdRegistry* dns_sd_registry_; 63 MockDnsSdRegistry* dns_sd_registry_;
62 }; 64 };
63 65
64 } // namespace 66 } // namespace
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 DnsSdRegistry::DnsSdServiceList services; 135 DnsSdRegistry::DnsSdServiceList services;
134 136
135 extensions::DnsSdService service; 137 extensions::DnsSdService service;
136 service.service_name = service_type; 138 service.service_name = service_type;
137 services.push_back(service); 139 services.push_back(service);
138 140
139 dns_sd_registry_->DispatchMDnsEvent(service_type, services); 141 dns_sd_registry_->DispatchMDnsEvent(service_type, services);
140 dns_sd_registry_->DispatchMDnsEvent(test_service_type, services); 142 dns_sd_registry_->DispatchMDnsEvent(test_service_type, services);
141 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 143 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
142 } 144 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/mdns/mdns_api_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698