OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/extensions/extension_browsertest.h" | 12 #include "chrome/browser/extensions/extension_browsertest.h" |
13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
17 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
18 #include "chrome/common/extensions/extension.h" | 18 #include "chrome/common/extensions/extension.h" |
19 #include "chrome/common/extensions/manifest.h" | 19 #include "chrome/common/extensions/manifest.h" |
20 #include "chrome/test/base/ui_test_utils.h" | 20 #include "chrome/test/base/ui_test_utils.h" |
21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
22 #include "content/public/test/browser_test_utils.h" | 22 #include "content/public/test/browser_test_utils.h" |
23 #include "googleurl/src/gurl.h" | 23 #include "googleurl/src/gurl.h" |
24 #include "net/base/mock_host_resolver.h" | 24 #include "net/dns/mock_host_resolver.h" |
25 | 25 |
26 using extensions::Extension; | 26 using extensions::Extension; |
27 | 27 |
28 class ChromeAppAPITest : public ExtensionBrowserTest { | 28 class ChromeAppAPITest : public ExtensionBrowserTest { |
29 protected: | 29 protected: |
30 bool IsAppInstalled() { return IsAppInstalled(""); } | 30 bool IsAppInstalled() { return IsAppInstalled(""); } |
31 bool IsAppInstalled(const char* frame_xpath) { | 31 bool IsAppInstalled(const char* frame_xpath) { |
32 const char kGetAppIsInstalled[] = | 32 const char kGetAppIsInstalled[] = |
33 "window.domAutomationController.send(window.chrome.app.isInstalled);"; | 33 "window.domAutomationController.send(window.chrome.app.isInstalled);"; |
34 bool result; | 34 bool result; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 GURL non_app_url(test_file_url.ReplaceComponents(replace_host)); | 310 GURL non_app_url(test_file_url.ReplaceComponents(replace_host)); |
311 | 311 |
312 // Check the install and running state of a non-app iframe running | 312 // Check the install and running state of a non-app iframe running |
313 // within an app. | 313 // within an app. |
314 ui_test_utils::NavigateToURL(browser(), app_url); | 314 ui_test_utils::NavigateToURL(browser(), app_url); |
315 | 315 |
316 EXPECT_EQ("not_installed", InstallState("//html/iframe[1]")); | 316 EXPECT_EQ("not_installed", InstallState("//html/iframe[1]")); |
317 EXPECT_EQ("cannot_run", RunningState("//html/iframe[1]")); | 317 EXPECT_EQ("cannot_run", RunningState("//html/iframe[1]")); |
318 EXPECT_FALSE(IsAppInstalled("//html/iframe[1]")); | 318 EXPECT_FALSE(IsAppInstalled("//html/iframe[1]")); |
319 } | 319 } |
OLD | NEW |