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 |