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

Unified Diff: extensions/shell/browser/dns_apitest.cc

Issue 412713002: Move apps/shell to extensions/shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 40% Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: extensions/shell/browser/dns_apitest.cc
diff --git a/apps/shell/browser/dns_apitest.cc b/extensions/shell/browser/dns_apitest.cc
similarity index 72%
rename from apps/shell/browser/dns_apitest.cc
rename to extensions/shell/browser/dns_apitest.cc
index 96736ea20243d0aef659361126bc858945584683..fa2ec2fa7858ce598b1d7a3aca0cca7a4f03f6b0 100644
--- a/apps/shell/browser/dns_apitest.cc
+++ b/extensions/shell/browser/dns_apitest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "apps/shell/test/shell_test.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -14,11 +13,13 @@
#include "extensions/browser/extension_function_dispatcher.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
+#include "extensions/shell/test/shell_test.h"
#include "net/base/net_errors.h"
-using extensions::ExtensionFunctionDispatcher;
using extensions::api_test_utils::RunFunctionAndReturnSingleResult;
+namespace extensions {
+
namespace {
class TestFunctionDispatcherDelegate
@@ -34,37 +35,35 @@ class TestFunctionDispatcherDelegate
} // namespace
-class DnsApiTest : public apps::AppShellTest {
+class DnsApiTest : public AppShellTest {
public:
- DnsApiTest() : resolver_creator_(new extensions::MockHostResolverCreator()) {}
+ DnsApiTest() : resolver_creator_(new MockHostResolverCreator()) {}
private:
virtual void SetUpOnMainThread() OVERRIDE {
- apps::AppShellTest::SetUpOnMainThread();
- extensions::HostResolverWrapper::GetInstance()->SetHostResolverForTesting(
+ AppShellTest::SetUpOnMainThread();
+ HostResolverWrapper::GetInstance()->SetHostResolverForTesting(
resolver_creator_->CreateMockHostResolver());
}
virtual void TearDownOnMainThread() OVERRIDE {
- extensions::HostResolverWrapper::GetInstance()->SetHostResolverForTesting(
- NULL);
+ HostResolverWrapper::GetInstance()->SetHostResolverForTesting(NULL);
resolver_creator_->DeleteMockHostResolver();
- apps::AppShellTest::TearDownOnMainThread();
+ AppShellTest::TearDownOnMainThread();
}
// The MockHostResolver asserts that it's used on the same thread on which
// it's created, which is actually a stronger rule than its real counterpart.
// But that's fine; it's good practice.
- scoped_refptr<extensions::MockHostResolverCreator> resolver_creator_;
+ scoped_refptr<MockHostResolverCreator> resolver_creator_;
};
IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsResolveIPLiteral) {
- scoped_refptr<extensions::DnsResolveFunction> resolve_function(
- new extensions::DnsResolveFunction());
- scoped_refptr<extensions::Extension> empty_extension(
- extensions::ExtensionBuilder()
- .SetManifest(extensions::DictionaryBuilder().Set("name", "Test").Set(
- "version", "1.0"))
+ scoped_refptr<DnsResolveFunction> resolve_function(new DnsResolveFunction());
+ scoped_refptr<Extension> empty_extension(
+ ExtensionBuilder()
+ .SetManifest(
+ DictionaryBuilder().Set("name", "Test").Set("version", "1.0"))
.Build());
resolve_function->set_extension(empty_extension.get());
@@ -92,12 +91,11 @@ IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsResolveIPLiteral) {
}
IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsResolveHostname) {
- scoped_refptr<extensions::DnsResolveFunction> resolve_function(
- new extensions::DnsResolveFunction());
- scoped_refptr<extensions::Extension> empty_extension(
- extensions::ExtensionBuilder()
- .SetManifest(extensions::DictionaryBuilder().Set("name", "Test").Set(
- "version", "1.0"))
+ scoped_refptr<DnsResolveFunction> resolve_function(new DnsResolveFunction());
+ scoped_refptr<Extension> empty_extension(
+ ExtensionBuilder()
+ .SetManifest(
+ DictionaryBuilder().Set("name", "Test").Set("version", "1.0"))
.Build());
resolve_function->set_extension(empty_extension.get());
@@ -108,7 +106,7 @@ IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsResolveHostname) {
new ExtensionFunctionDispatcher(browser_context(), &delegate));
std::string function_arguments("[\"");
- function_arguments += extensions::MockHostResolverCreator::kHostname;
+ function_arguments += MockHostResolverCreator::kHostname;
function_arguments += "\"]";
scoped_ptr<base::Value> result(
RunFunctionAndReturnSingleResult(resolve_function.get(),
@@ -124,5 +122,7 @@ IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsResolveHostname) {
std::string address;
EXPECT_TRUE(dict->GetString("address", &address));
- EXPECT_EQ(extensions::MockHostResolverCreator::kAddress, address);
+ EXPECT_EQ(MockHostResolverCreator::kAddress, address);
}
+
+} // namespace extensions
« no previous file with comments | « extensions/shell/browser/default_shell_browser_main_delegate.cc ('k') | extensions/shell/browser/shell_app_sorting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698