LCOV - code coverage report
Current view: top level - dom/bindings/test - TestInterfaceIterableDoubleUnion.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 36 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 14 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* This Source Code Form is subject to the terms of the Mozilla Public
       2             :  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
       3             :  * You can obtain one at http://mozilla.org/MPL/2.0/. */
       4             : 
       5             : #include "mozilla/dom/TestInterfaceIterableDoubleUnion.h"
       6             : #include "mozilla/dom/TestInterfaceJSMaplikeSetlikeIterableBinding.h"
       7             : #include "nsPIDOMWindow.h"
       8             : #include "mozilla/dom/BindingUtils.h"
       9             : 
      10             : namespace mozilla {
      11             : namespace dom {
      12             : 
      13           0 : NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TestInterfaceIterableDoubleUnion, mParent)
      14             : 
      15           0 : NS_IMPL_CYCLE_COLLECTING_ADDREF(TestInterfaceIterableDoubleUnion)
      16           0 : NS_IMPL_CYCLE_COLLECTING_RELEASE(TestInterfaceIterableDoubleUnion)
      17             : 
      18           0 : NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TestInterfaceIterableDoubleUnion)
      19           0 : NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
      20           0 : NS_INTERFACE_MAP_ENTRY(nsISupports)
      21           0 : NS_INTERFACE_MAP_END
      22             : 
      23           0 : TestInterfaceIterableDoubleUnion::TestInterfaceIterableDoubleUnion(nsPIDOMWindowInner* aParent)
      24           0 :   : mParent(aParent)
      25             : {
      26           0 :   OwningStringOrLong a;
      27           0 :   a.SetAsLong() = 1;
      28           0 :   mValues.AppendElement(std::pair<nsString, OwningStringOrLong>(NS_LITERAL_STRING("long"),
      29           0 :                                                                 a));
      30           0 :   a.SetAsString() = NS_LITERAL_STRING("a");
      31           0 :   mValues.AppendElement(std::pair<nsString, OwningStringOrLong>(NS_LITERAL_STRING("string"),
      32           0 :                                                                 a));
      33           0 : }
      34             : 
      35             : //static
      36             : already_AddRefed<TestInterfaceIterableDoubleUnion>
      37           0 : TestInterfaceIterableDoubleUnion::Constructor(const GlobalObject& aGlobal,
      38             :                                               ErrorResult& aRv)
      39             : {
      40           0 :   nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal.GetAsSupports());
      41           0 :   if (!window) {
      42           0 :     aRv.Throw(NS_ERROR_FAILURE);
      43           0 :     return nullptr;
      44             :   }
      45             : 
      46           0 :   RefPtr<TestInterfaceIterableDoubleUnion> r = new TestInterfaceIterableDoubleUnion(window);
      47           0 :   return r.forget();
      48             : }
      49             : 
      50             : JSObject*
      51           0 : TestInterfaceIterableDoubleUnion::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
      52             : {
      53           0 :   return TestInterfaceIterableDoubleUnionBinding::Wrap(aCx, this, aGivenProto);
      54             : }
      55             : 
      56             : nsPIDOMWindowInner*
      57           0 : TestInterfaceIterableDoubleUnion::GetParentObject() const
      58             : {
      59           0 :   return mParent;
      60             : }
      61             : 
      62             : size_t
      63           0 : TestInterfaceIterableDoubleUnion::GetIterableLength()
      64             : {
      65           0 :   return mValues.Length();
      66             : }
      67             : 
      68             : nsAString&
      69           0 : TestInterfaceIterableDoubleUnion::GetKeyAtIndex(uint32_t aIndex)
      70             : {
      71           0 :   MOZ_ASSERT(aIndex < mValues.Length());
      72           0 :   return mValues.ElementAt(aIndex).first;
      73             : }
      74             : 
      75             : OwningStringOrLong&
      76           0 : TestInterfaceIterableDoubleUnion::GetValueAtIndex(uint32_t aIndex)
      77             : {
      78           0 :   MOZ_ASSERT(aIndex < mValues.Length());
      79           0 :   return mValues.ElementAt(aIndex).second;
      80             : }
      81             : 
      82             : } // namespace dom
      83             : } // namespace mozilla

Generated by: LCOV version 1.13