xref: /trunk/main/slideshow/test/views.cxx (revision d9ee14b8)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #include <cppuhelper/compbase1.hxx>
25 #include <comphelper/broadcasthelper.hxx>
26 
27 #include <basegfx/matrix/b2dhommatrix.hxx>
28 #include <basegfx/range/b2drectangle.hxx>
29 #include <cppcanvas/spritecanvas.hxx>
30 
31 #include "view.hxx"
32 #include "unoview.hxx"
33 #include "unoviewcontainer.hxx"
34 #include "shape.hxx"
35 #include "tests.hxx"
36 #include "gtest/gtest.h"
37 #include "com/sun/star/presentation/XSlideShowView.hpp"
38 
39 namespace target = slideshow::internal;
40 using namespace ::com::sun::star;
41 
42 namespace
43 {
44 
45 class UnoViewContainerTest : public ::testing::Test
46 {
47 public:
48 }; // class UnoViewContainerTest
49 
50 TEST_F(UnoViewContainerTest, testContainer)
51 {
52     target::UnoViewContainer aContainer;
53 
54     TestViewSharedPtr pView = createTestView();
55     aContainer.addView( pView );
56 
57     ASSERT_TRUE( 1 == std::distance( aContainer.begin(), aContainer.end() )) << "Testing container size";
58     ASSERT_TRUE( pView->paintScreen() ) << "Testing disposedness";
59     aContainer.dispose();
60     ASSERT_TRUE( 0 == std::distance( aContainer.begin(), aContainer.end() )) << "Testing dispose: container must be empty";
61     ASSERT_TRUE( !pView->paintScreen() ) << "Testing dispose: all elements must receive dispose";
62 }
63 
64 
65 } // namespace
66