This source file includes following definitions.
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
#include "chrome/browser/apps/app_browsertest_util.h"
#include "chrome/browser/extensions/api/management/management_api.h"
#include "chrome/browser/extensions/api/runtime/runtime_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_function_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimePrivileged) {
ASSERT_TRUE(RunExtensionTest("runtime/privileged")) << message_;
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimeUnprivileged) {
ASSERT_TRUE(StartEmbeddedTestServer());
ASSERT_TRUE(
LoadExtension(test_data_dir_.AppendASCII("runtime/content_script")));
ResultCatcher catcher;
ui_test_utils::NavigateToURL(browser(),
embedded_test_server()->GetURL("/webpage.html"));
EXPECT_TRUE(catcher.GetNextResult()) << message_;
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimeUninstallURL) {
extensions::ManagementUninstallFunction::SetAutoConfirmForTest(true);
ASSERT_TRUE(LoadExtension(
test_data_dir_.AppendASCII("runtime").AppendASCII("uninstall_url").
AppendASCII("sets_uninstall_url")));
ASSERT_TRUE(RunExtensionTest("runtime/uninstall_url")) << message_;
}
namespace extensions {
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimeGetPlatformInfo) {
scoped_ptr<base::Value> result(
extension_function_test_utils::RunFunctionAndReturnSingleResult(
new RuntimeGetPlatformInfoFunction(),
"[]",
browser()));
ASSERT_TRUE(result.get() != NULL);
base::DictionaryValue* dict =
extension_function_test_utils::ToDictionary(result.get());
ASSERT_TRUE(dict != NULL);
EXPECT_TRUE(dict->HasKey("os"));
EXPECT_TRUE(dict->HasKey("arch"));
EXPECT_TRUE(dict->HasKey("nacl_arch"));
}
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
ChromeRuntimeGetPackageDirectoryEntryApp) {
ClearCommandLineArgs();
ASSERT_TRUE(RunPlatformAppTest("api_test/runtime/get_package_directory/app"))
<< message_;
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest,
ChromeRuntimeGetPackageDirectoryEntryExtension) {
ASSERT_TRUE(RunExtensionTest("runtime/get_package_directory/extension"))
<< message_;
}
}