LCOV - code coverage report
Current view: top level - dom/script - ScriptTrace.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 7 12 58.3 %
Date: 2017-07-14 16:53:18 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       2             : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
       3             : /* This Source Code Form is subject to the terms of the Mozilla Public
       4             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       5             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       6             : 
       7             : #include "ScriptTrace.h"
       8             : 
       9             : namespace mozilla {
      10             : namespace dom {
      11             : namespace script {
      12             : 
      13             : static nsresult
      14          15 : TestingDispatchEvent(nsIScriptElement* aScriptElement,
      15             :                      const nsAString& aEventType)
      16             : {
      17             :   static bool sExposeTestInterfaceEnabled = false;
      18             :   static bool sExposeTestInterfacePrefCached = false;
      19          15 :   if (!sExposeTestInterfacePrefCached) {
      20           1 :     sExposeTestInterfacePrefCached = true;
      21             :     Preferences::AddBoolVarCache(&sExposeTestInterfaceEnabled,
      22             :                                  "dom.expose_test_interfaces",
      23           1 :                                  false);
      24             :   }
      25          15 :   if (!sExposeTestInterfaceEnabled) {
      26          15 :     return NS_OK;
      27             :   }
      28             : 
      29           0 :   nsCOMPtr<nsINode> target(do_QueryInterface(aScriptElement));
      30           0 :   if (!target) {
      31           0 :     return NS_OK;
      32             :   }
      33             : 
      34             :   RefPtr<AsyncEventDispatcher> dispatcher =
      35           0 :     new AsyncEventDispatcher(target, aEventType, true, false);
      36           0 :   return dispatcher->PostDOMEvent();
      37             : }
      38             : 
      39             : } // script namespace
      40             : } // dom namespace
      41           9 : } // mozilla namespace

Generated by: LCOV version 1.13