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

Unified Diff: chrome/test/functional/execute_javascript.py

Issue 222873002: Remove pyauto tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 9 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
« no previous file with comments | « chrome/test/functional/crash_reporter.py ('k') | chrome/test/functional/extensions.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/execute_javascript.py
===================================================================
--- chrome/test/functional/execute_javascript.py (revision 261231)
+++ chrome/test/functional/execute_javascript.py (working copy)
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import sys
-import unittest
-
-import pyauto_functional
-from pyauto import PyUITest
-
-
-class ExecuteJavascriptTest(PyUITest):
- def _GetExtensionInfoById(self, extensions, id):
- for x in extensions:
- if x['id'] == id:
- return x
- return None
-
- def testExecuteJavascript(self):
- self.NavigateToURL(self.GetFileURLForDataPath(
- 'frame_dom_access', 'frame_dom_access.html'))
-
- v = self.ExecuteJavascript('window.domAutomationController.send(' +
- 'document.getElementById("myinput").nodeName)')
- self.assertEqual(v, 'INPUT')
-
- def testGetDOMValue(self):
- self.NavigateToURL(self.GetFileURLForDataPath(
- 'frame_dom_access', 'frame_dom_access.html'))
-
- v = self.GetDOMValue('document.getElementById("myinput").nodeName')
- self.assertEqual(v, 'INPUT')
-
- def testExecuteJavascriptInExtension(self):
- """Test we can inject JavaScript into an extension."""
- dir_path = os.path.abspath(
- os.path.join(self.DataDir(), 'extensions', 'js_injection_background'))
- ext_id = self.InstallExtension(dir_path)
-
- # Verify extension is enabled.
- extension = self._GetExtensionInfoById(self.GetExtensionsInfo(), ext_id)
- self.assertTrue(extension['is_enabled'],
- msg='Extension was disabled by default')
-
- # Get the background page's view.
- background_view = self.WaitUntilExtensionViewLoaded(
- view_type='EXTENSION_BACKGROUND_PAGE')
- self.assertTrue(background_view,
- msg='problematic background view: views = %s.' %
- self.GetBrowserInfo()['extension_views'])
-
- # Get values from background page's DOM
- v = self.ExecuteJavascriptInRenderView(
- 'window.domAutomationController.send('
- 'document.getElementById("myinput").nodeName)', background_view)
- self.assertEqual(v, 'INPUT',
- msg='Incorrect value returned (v = %s).' % v)
- v = self.ExecuteJavascriptInRenderView(
- 'window.domAutomationController.send(bool_var)', background_view)
- self.assertEqual(v, True, msg='Incorrect value returned (v = %s).' % v)
- v = self.ExecuteJavascriptInRenderView(
- 'window.domAutomationController.send(int_var)', background_view)
- self.assertEqual(v, 42, msg='Incorrect value returned (v = %s).' % v)
- v = self.ExecuteJavascriptInRenderView(
- 'window.domAutomationController.send(str_var)', background_view)
- self.assertEqual(v, 'foo', msg='Incorrect value returned (v = %s).' % v)
-
-
-if __name__ == '__main__':
- pyauto_functional.Main()
« no previous file with comments | « chrome/test/functional/crash_reporter.py ('k') | chrome/test/functional/extensions.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698